Reputation: 27199
HI I like to know why final and abstract modifiers used for local inner class in java.... Can anybody elaborate on this?
Upvotes: 0
Views: 2652
Reputation: 3549
It does not matters if your class is local, inner or top level class. You can use only either of abstract or final modifiers with all of them but not both.
.
When you use abstract
modifier for class, it means:
.
When you use final
modifier for class, it means:
Reference:
8.1.1.1 abstract Classes:
http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#34944
8.1.1.2 final Classes:
http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#54727
Upvotes: 1
Reputation: 4607
There's a great example of the usage of abstract inner classes at o'reilly, please look at look at the 'hierarchies of inner classes' section:
http://onjava.com/pub/a/onjava/excerpt/HardcoreJava_chap06/index.html
Upvotes: 1