This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I just tried the exumalator's question of the day, and I have a question:
1. char h = 1; //on the line before the System.out.println statement. 2. static char h = 1; //On the line before the System.out.println statement 3. char h = 1;//On the line before the main method 4. static char h = 1;//On the line before the main method
The answer is listed as 1 and 4, which is fine, but I also think 2 is also an option. Can't you put static variables inside a static method?
i agree with Owen.....we cannot have any other variable modifier inside a method. As listed in the rules governing staic declarations in K & B book, I think that anything that is method-local cannot be static.