java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: <any>
at javaapplication1.JavaApplication1.main(JavaApplication1.java:43)
A part of the Code:
public class JavaApplication1 {How to fix the problem:
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try{
Car car = new Car();
car.defineColor('gray');
}
catch (Exception e){
e.printStackTrace ();
}
// TODO code application logic here
}
}
car.defineColor('gray');Code after edited:
car.defineColor("gray");
public class JavaApplication1 {Reason by Ravi Thapliyal :
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try{
Car car = new Car();
car.defineColor("gray");
}
catch (Exception e){
e.printStackTrace ();
}
// TODO code application logic here
}
}
Java uses double quotes for "String" and single quotes for 'C'haracters. So in my case, i should not use singe quotes for the String gray, i should use double quotes for it.
No comments :
Post a Comment