有包的程序在命令行如何运行

package csq;

public class Test{
    public static void main(String args[]){
        System.out.println("welcome to the hell");
    }
}
/*-----  注意运行   -----

    C:\>cd csq
    
    C:\csq>javac Test.java
    
    C:\csq>cd ..
    
    C:\>java csq.Test
    welcome to the hell
    
    C:\>

    //先进入所在的包(文件夹)内编译好,再返回包的上一层文件夹,运行 包名.类名 
*/

 

posted @ 2013-03-16 14:59  LaoQuans  阅读(217)  评论(0编辑  收藏  举报