From "Java Language Specification":
"An identifier is an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter. An identifier cannot have the same spelling (Unicode character sequence) as a keyword, Boolean literal, or the null literal."
> See documentation for details.
Usually, when an identifier error occurs, the code did not declare that identifier or maybe mispelled the identifier. For example:
int i;
System.out.println("The value of y is " + y); //identifier error here because y is not declared
- - - - - - - - - - - -
//another example Myclass is defined
class Myclass {
private String className = "This is Myclass";
public Myclass() { }
public testMethod() { System.out.println("test method invoked"); }
}
//in the main method
Myclass example = new Myclass();
example.myMethod(); // identifier error here because myMethod is not declared in Myclass