Monday, January 16, 2012

How to i fix this error so i can compile my java program?

You can't put a static variable inside a method in Java. The reason is that static variables are cl variables that all instances of the cl share. Since all variables declared inside a method are local to that method, you cannot declare them to be static.

No comments:

Post a Comment