aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Are these correct forms of inner class?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Are these correct forms of inner class??" Watch "Are these correct forms of inner class??" New topic
Author

Are these correct forms of inner class??

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Are following correct forms of inner class:
A. private final abstract class in
B. new innerclass() implements someinterface
Marcela Blei
Ranch Hand

Joined: Jun 28, 2000
Posts: 477
NO.
>A. private final abstract class in
You can�t use abstract and final modifiers at the same time. Think about the concept of each one. But you may use the private modifier for an inner class and you can declare an inner class to be abstract or final.
>B. new innerclass() implements someinterface
This one is supose to be an anonymous inner class? When you declare this kind on inner classes you can�t use the extends or implements keywords and you have to implement the class.
eg.

where the: new SomeInterface() {
(look at the open braces) means: implements SomeInterface with the following code.
I don�t know if that was clear, try reading a bit about anonymous inner classes.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Are these correct forms of inner class??
 
Similar Threads
instantiating class issue
Are these correct forms of inner class??
Creating classes question: source - Santis Self Tester
classes(inner, nested)
Beginner question on objects