Sajjad Dar wrote:why do we have to mark a variable final if we want to access it from a method local class.
Sajjad Dar wrote:x will be stored on the stack and when the fucntion ends the stack gets blown away.
Sajjad Dar wrote: Both would or should be defined on a stack.
Sajjad Dar wrote:Secondly i don't understand how marking a variable final increases its life.
hi Prithvi, Good luck with holiday and the course completion.Prithvi Sehgal wrote:Hi,
Seems i am on a holiday till 5th of May till i don't complete my course![]()
Will only ask doubts![]()
Best Regards,
Those are interesting questions. An abstract inner class means the same as any other kind of abstract class. It can serve as a parent for various other inner classes. The two modifiers, "abstract" and "final" are the only two modifiers allowed for method level inner classes. The other modifiers: "private, "public", "protected", "static", "volatile", and "transient" doesn't make sense for method local variables and for the same reason can't be applied to method level inner classes. That leaves only the "abstract" and "final" modifiers that make sense for those inner classes.Sajjad Dar wrote: Also could you tell me what it means for an inner level class to be abstract ? Why would we want to mark an inner level class abstract ? Also can a method level inner class inherit from classes out the class in which it has been defined ? What are the rules to this.
SCJP 6
Don't get me started about those stupid light bulbs. |