Topic: 无发编译.class文件

  Print this page

1.无发编译.class文件 Copy to clipboard
Posted by: cowone
Posted on: 2005-06-06 11:51

public class vehicleDriver{
public String name; //定义司机的名字
/**
*vehicleDriver类构造函数
*/
public vehicleDriver(){
name = "TOM"; //设置司机的名字为TOM
}//vehicleDriver()
/**
*vehicleDriver类对象的work方法
*/
public void work(){
vehicle v = new vehicle(); //生成vehicle类的对象v
v.driveAt(45); //调用v对象所固有的driveAt()方法
}//work()
public static void main(String arg[]){
//生成vehicleDriver类的对象vd
vehicleDriver vd = new vehicleDriver();
vd.work(); //调用vd对象所固有的work()方法
}//main()
}/** vehicleDriver */

不知道哪里有错啊...

2.Re:无发编译.class文件 [Re: cowone] Copy to clipboard
Posted by: why
Posted on: 2005-06-06 12:00

Dead Show us the error message!!!!!!
Show us vehicle.java

use [ code ]
Read [加贴须知] 提高发问技巧

3.Re:无发编译.class文件 [Re: cowone] Copy to clipboard
Posted by: cowone
Posted on: 2005-06-06 13:31

我也不知道哪里有错啊....想问问你们..

4.Re:无发编译.class文件 [Re: cowone] Copy to clipboard
Posted by: qch455
Posted on: 2005-06-06 14:53

v.driveAt(45)??

5.Re:无发编译.class文件 [Re: cowone] Copy to clipboard
Posted by: why
Posted on: 2005-06-06 17:39

cowone wrote:
我也不知道哪里有错啊....想问问你们..

Dead
Dead
Dead x 1000
我们问你有甚麼错誤信息


就算你答不出這個,
也不會沒有vehicle.java吧


把這個放進 vehicleDriver 裡好了
class vehicle { // should be Vehicle, and VehicleDriver by convention
  int speed;
  
  void driveAt(int _speed) {
    speed = _speed;
  }
}

6.Re:无发编译.class文件 [Re: cowone] Copy to clipboard
Posted by: cowone
Posted on: 2005-06-06 18:41

kan

7.Re:无发编译.class文件 [Re: cowone] Copy to clipboard
Posted by: why
Posted on: 2005-06-06 20:56

Dead x 10,000

> javac vehicleDriver.java

> java vehicleDriver


BTW, you can cut-n-paste the contents inside the Command Prompt window by selecting the area to copy with your mouse and press Enter.


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923