Please can somebody tell me if we can declare inner classes with in a method to be static or private. If i compile it, it gives me a error, although error it shows is different, but is due to that only, whereas as Khalid-Mughal and marcus green exam 1 question no. 30 says so. Please help me about it
Hi Akhil, You must have missed it in KM book (page 238) Local classes can NOT have any accessibility specified. The class is defined as static or not depending on whether the method is static or not. For example, a local class defined in a static method will be considered static, while a local class defined in a non-static method will be considered non-static. Regards, Manfred.