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);

解决方案 »

  1.   


    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();
    }
      

  2.   

    是t不是r
    System.out.prin"r"ln("this motocycle is a" + make + color1);
      

  3.   

    System.out.prinrln("this motocycle is a" + make + color1); 打错了,哥们,查程序要仔细啊
      

  4.   

    11.java:7: 找不到符号 
    符号: 方法 prinrln就是说找不到 prinrln 这个方法
      

  5.   

    呵呵,以后写程序多用心阿,还有就是要用个IDE最好