java 源代码内容如下:
class MotorCycle{
String make;
String color1;
boolean engineState;void showAtts(){
System.out.prinrln("this motocycle is a" + make + color1);
if(engineState==true)
System.out.println("the engine is start");
else System.out.println("the engine is off");
}
public static void main(String args[]){
MotorCycle m=new MotorCycle();
m.make="Yamaha RZ350";
m.color1="silver";
System.out.println("calling show attributes.....");
m.showAtts();
}
}编译时报如下错误:
11.java:7: 找不到符号
符号: 方法 prinrln<java.lang.String>
位置: 类 java.io.PrintStream
System.out.prinrln("this motocycle is a" + make + color1);
class MotorCycle{
String make;
String color1;
boolean engineState;void showAtts(){
System.out.prinrln("this motocycle is a" + make + color1);
if(engineState==true)
System.out.println("the engine is start");
else System.out.println("the engine is off");
}
public static void main(String args[]){
MotorCycle m=new MotorCycle();
m.make="Yamaha RZ350";
m.color1="silver";
System.out.println("calling show attributes.....");
m.showAtts();
}
}编译时报如下错误:
11.java:7: 找不到符号
符号: 方法 prinrln<java.lang.String>
位置: 类 java.io.PrintStream
System.out.prinrln("this motocycle is a" + make + color1);
String make;
String color1;
boolean engineState; void showAtts() {
System.out.println("this motocycle is a" + make + color1);
if (engineState == true)
System.out.println("the engine is start");
else
System.out.println("the engine is off");
} public static void main(String args[]) {
MotorCycle m = new MotorCycle();
m.make = "Yamaha RZ350";
m.color1 = "silver";
System.out.println("calling show attributes.....");
m.showAtts();
}
System.out.prin"r"ln("this motocycle is a" + make + color1);
符号: 方法 prinrln就是说找不到 prinrln 这个方法