0
When I declared a variable like public int n the compiler is showing an error stating that it is the illegal start of an expression. Why is that. I am using JDK 1.8. Please help
3 ответов
0
I'm guessing youre putting the public int in a method? like the main method? If so, there's the problem. A method, including the main method, can only accept local variables. No public identifier. Can remove the public, or place it outside the main method/other methods.
0
Thanks. It worked
- 1
when you do public int make sure int is in ( )