class if{
public static void main (String args[]){
int x = 9;
if (x <= 9){
System.out.println("Yay");
}else{
System.out.println("Yay");
}
}
}
我从编译器运行这个,使用Notepad ++作为文本编辑器。我在编译器中发现错误<identifier> expected class if
。另一个错误说illegal start of expression
。 以及说error ";" expected
。我总共有9个错误。Java编译器错误消息“<identifier>预计”是什么意思?
我确保匹配所有{}
和()
。即使刮了程序,并再次尝试相同的结果。
这将会是有益的,如果你发布的确切编译器错误。 –
检查Java语言关键字:http://download.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html –