What does the Java compiler error message “ expected” mean?

后端 未结 5 913
眼角桃花
眼角桃花 2021-01-19 02:26
class if{
    public static void main (String args[]){
        int x = 9;
        if (x <= 9){
            System.out.println(\"Yay\");
        }else{
                    


        
5条回答
  •  花落未央
    2021-01-19 03:13

    You can't name your class if, as it's a keyword. Check this for more examples.

提交回复
热议问题