java缺少返回语句错误,我不知道是什么错误
这是密码
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");
}
}
# 1 楼答案
这是
Void
报税单Void
实际上是一个类为了解决你的问题,你必须把它改成小写的
void
资源: