下面是代碼,缺少返回語句錯誤,我不知道有什麼錯誤
class Car
{
public static String owner;
public static String car;
public static Integer plate_num;
public static String car_color;
Car(String owner, String car_name, Integer num, String color)
{
owner = owner;
car = car_name;
plate_num = num;
car_color = color;
}
Void display()
{
System.out.println("The owner of the car is "+ owner + "and Car model is " + car);
System.out.println("The car number is "+ plate_num + "and Car color is " + car_color);
} // ---> here is the error
public static void main (String args[])
{
Car car1 = new Car("MAriam", "Mini Cooper", 124834, "Navey");
car1.display() ;
//System.out.println("Y3es");
}
}
開始使用IDE的正確時間。 netbeans/eclipse – GoodSp33d 2010-09-20 08:18:20