the modifier final can be applied to a local class..that means a final local class cannot have subclasses...does it mean that if the modifier final is not applied, u can extend the local class?....but the local class is local to the block in which it is created and cant be accessed outside that block...isn't it contradictory?
thanx barry..i didn't get that idea....extending local class in the block in which it is declared....thanx a lot for the example too...but can u extend a local class outside the block in which it is declared?
hi benjamin..i wasn't refering to an inner class...inner classes can be extended even outside the class in which they r declared
Sandy<br />SCJP1.4 SCWCD1.4<br />SCBCD(preparing)
posted 14 years ago
but can u extend a local class outside the block in which it is declared?
Best left as an exercise for the student... Write some code to test the hypothesis.
If your definition of local class is a class declared inside a method; and you want to extend that "local" class "out side" the method, i don't think it is possible, since by the very definition of "local variables" the scope is limited to that block/method and convetionally all the local variables are destroyed once the method exists. The very reason of decalring them final is to extend their life times.
I hope i got your question right and this helps.
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database