日期:2014-05-20  浏览次数:20659 次

急急急 问个关于命令行下运行java程序的问题?
为什么我的程序在eclipse下可以运行
而在命令行下却不能运行呢
编译都不通过
这是什么原因?谢谢


源程序
1.

package   lala;

public   class   Computer   {

/**
  *   Computer     Class
  */
protected   String   PC_name;       //属性     名字  
protected   String   pc_color;     //..   颜色
protected   String   pc_type;       //..   型号
protected   int   pc_ram;               //内存容量
protected   int   pc_harddisk;     //硬盘容量
protected   float   pc_price;   //价格
 
protected   int   pc_state=0;   //         工作状态     0为   停止       1   运行     -1   挂起    



Computer(){         //无参的构造函数,什么都不做

}

public   Computer(String   myname,String   mycolor,String   mytype,int   myram,int   myhard,float   myprice)       //带参数的构造函数
{
        this.PC_name=myname;
this.pc_color=mycolor;
this.pc_type=mytype;
this.pc_ram=myram;
this.pc_harddisk=myhard;
this.pc_price=myprice;
}


public   void   pc_open(){           //打开方法
pc_state=1;
}
public   void   pc_close(){         //关闭方法  
pc_state=0;
}
public   void   pc_hitch(){           //挂其方法  
      pc_state=-1;
    }

public   void   set(String   myname,String   mycolor,String   mytype,int   myram,int   myhard,float   myprice){     //set方法,设置各属性值      
this.PC_name=myname;
this.pc_color=mycolor;
this.pc_type=mytype;
this.pc_ram=myram;
this.pc_harddisk=myhard;
this.pc_price=myprice;
}

public   void   setcolor(String   str){         //本类的方法,其它类似
this.pc_color=str;
}
public   void   getcolor(){
System.out.println( "颜色:   "+pc_color);
}
public   void   get(){           //get方法输出各字短值
System.out.println( "品牌:   "+PC_name);
System.out.println( "颜色:   "+pc_color);
System.out.println( "CPU型号:   "+pc_type);
System.out.println( "内存:   "+pc_ram);
System.out.println( "硬盘:   "+pc_harddisk);
System.out.println( "价格:   "+pc_price);
System.out.println( "工作状态:   "+pc_state);
}
}

这是父类


2.
package   lala;

public   class   BookComputer   extends   Computer   {

/**
  *   笔记本class
  *   by   hip   07/7/9
  */
private   float   Bookpc_long;   //机箱长度
private   float   Bookpc_width;//机箱宽度
private   float   Bookpc_thick;//机向后度
private   float   Bookpc_weight;//机葙重量
private   boolean     Bookpc_cellstate=false;//电池状态     注:   false为不工作状态,true为电池工作状态;莫认为0      

BookComputer(){     //默认的无参构造函数

}
public   BookComputer(String   myname,String   mycolor,String   mytype,int   myram,int   myhard,float   myprice,float   mylong,float   mywidth,float   mythick,float   myweight){     //带参数的构造函数