• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between classes??

 
ankush walia
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI EVERYONE;
CAN ANYONE TELL ME WHAT IS THE DIFFERENCE BETWEEN
"ADAPTER CLASS" AND "ANONYMOUS CLASS"
AND ALSO IF THERE IS ANY DIFFERENCE BETWEEN THE TWO BASED ON THEIR RUNTIME AND COMPILE TIME CHARACTERISITICS??
ankush!!
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ankush,
An Anonymous class is any class you create that doesn't have a name and therefore cannot contain constructors.
An Adapter class is a class that Java provides that implements a certain AWT event listener. An Adapter class is present for any event listener interface that requires more than 1 method to be implemented. The class provides empty methods so that when you extend them you don't need to type as much!
The major difference is that they are two different concepts in Java...
Regards,
Manfred.
 
ryan burgdorfer
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankush,
Perhaps you thought they were somoehow related because they are both commonly nested. Check out this article here at the ranch: http://javaranch.com/campfire/StoryInner.jsp
~Ryan
 
elavazhagan selvaraj
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Anonymous class is the inner class which doesn't have the name.
Adapter class is the class which is provided by java api for awt
implementaion. This is very useful in awt classes in which by using the adapter class there is no need to implement all the methods in the awt classes & interfaces.
visit.........http:\\www.javaworld.com
regards,
elavazhagan
elavazhagan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic