This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
while taking some mock exams I got 2 contradictory statements. 1) non-static inner classes cannot have static members. 2)inner classes may only declare static members if are compile time constants. I tested this and found that statement 2 is correct. they can have static members if they are also final. I only tested it for member variables(not for methods).
According to JLS non-static inner class can have static variables if they are compile-time constants. From several test cases I ran, it seems that you cannot have a static local variable, even in a static context (static method, for example). If this a general rule or just an exception...oh no, not the checked exception you may think of :-)
subject: non-static inner classes with static members