hi,
can anyone explain me the wat is anonymous inner class and adapter class.. i searched through the forum but i could nt get it....
Explain anonymous inner class and adapter class
Page 1 of 14 Replies - 1081 Views - Last Post: 13 July 2011 - 06:14 AM
Replies To: Explain anonymous inner class and adapter class
#2
Re: Explain anonymous inner class and adapter class
Posted 13 July 2011 - 05:56 AM
Inner class - Just another class defined in a class or interface.
#3
Re: Explain anonymous inner class and adapter class
Posted 13 July 2011 - 05:59 AM
I changed your title from "Question" to something that actually DESCRIBES your issue. Don't use stupid titles like "Question"...we KNOW you have a question, DUH! Use a title that describes your issue.
#4
Re: Explain anonymous inner class and adapter class
Posted 13 July 2011 - 06:01 AM
ya that fine... but we use anonymous inner class within an action listener....am i right.. but i want hte exzt meanin
#5
Re: Explain anonymous inner class and adapter class
Posted 13 July 2011 - 06:14 AM
Anonymous inner classes are just classes without names. Often times you see them defined with interfaces using the syntax:
Anonymous and named inner classes both can have other fields, other methods, etc., just like normal outer classes. You can also define an anonymous inner class when instantiating an Object from a class. As an example:
The only thing with anonymous inner classes is that you can't define constructors for them, as they aren't named.
new InterfaceName(){
//override abstract methods here
}
Anonymous and named inner classes both can have other fields, other methods, etc., just like normal outer classes. You can also define an anonymous inner class when instantiating an Object from a class. As an example:
JPanel panel = new JPanel(){
public void paint(Graphics g){
super.paint(g);
}
};
The only thing with anonymous inner classes is that you can't define constructors for them, as they aren't named.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote








|