wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Inner Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inner Class" Watch "Inner Class" New topic
Author

Inner Class

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Q1
Can i add abstract inner class ?
i'm not sure Is it valid decleartion in the INNER Classes,
abstract class XXXX
Q2
can i add arguments to the Anonymous Class
for example : new MyClass(x){
//some code
}
Vasanth Appaji
Greenhorn

Joined: Aug 22, 2000
Posts: 13
Yes, you can add abstract inner classes.
Anonymous classes are those that do not have any names and are directly instantiated when created. So, the name that comes after the new operator is the class that the anonymous class extends or the interface that it implements(only one at a time). So, you can add arguments to the anonymous class, provided that the the class you are extending has that constructor. Obviously, with anonymous classes implementing interfaces, you cannot do this.
Please correct me if I'm wrong.
--Vasanth
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inner Class
 
Similar Threads
Inner class
inner class
Innner Class
How to use Abstract inner classes ?
inner class