ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Java Related >> Java J2EE >> Core Java
 
 


 

 
 Core Java interview questions  Core Java Interview Questions (1721)
 Advanced Java interview questions  Advanced Java Interview Questions (331)
 Swing interview questions  Swing Interview Questions (44)
 EJB interview questions  EJB Interview Questions (134)
 Servlets interview questions  Servlets Interview Questions (255)
 Struts interview questions  Struts Interview Questions (196)
 JDBC interview questions  JDBC Interview Questions (187)
 JMS interview questions  JMS Interview Questions (9)
 SunOne interview questions  SunOne Interview Questions (3)
 J2EE interview questions  J2EE Interview Questions (71)
 Weblogic interview questions  Weblogic Interview Questions (146)
 Websphere interview questions  Websphere Interview Questions (14)
 Java Networking interview questions  Java Networking Interview Questions (20)
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions (87)
Question
What is adapter class?
 Question Submitted By :: Core-Java
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
Java Language rule are such that we must implement all the
methods of an interface even if we put them into empty
braces.i.e. we must override all the methods declared in
the interface.

But we can create our classes as subclasses of one of
the adapter classes, then we need to override only some of
the methods we need. i.e, An adapter classes provide empty
implementation of all methods declared in an EventListener
interface.
 
Is This Answer Correct ?    187 Yes 25 No
Selvi
 
Answer
# 2
Adapter class provides an empty implementation of all the
methods in EventListener interface.
 
Is This Answer Correct ?    180 Yes 40 No
Niranjanravi
 
 
 
Answer
# 3
In java programming language, adapter class is used to
implement an interface having a set of dummy methods. The
developer can then further subclass the adapter class so
that he can override to the methods he requires.
Implementing an interface directly, requires to write all
the dummy methods. In general an adapter class is used to
rapidly construct your own Listener class to field events.
 
Is This Answer Correct ?    54 Yes 8 No
Khan
 
Answer
# 4
in a java programming language if you have a not all method
use but only selected method used at that time you can use
adapter class.you can use either one or all method.
 
Is This Answer Correct ?    27 Yes 6 No
Pratik Vegad
 
Answer
# 5
Adapter classes are empty implementation of the methods provided by their corresponding interfaces.
if we implements the interface we have to give definition to all methods of interface.
but if we extend adapter class then we will require to define method which we gonna use in our code
 
Is This Answer Correct ?    19 Yes 5 No
Akki
 
Answer
# 6
A class which having a methods and those are having dummy
implementation (no implementation).
 
Is This Answer Correct ?    12 Yes 2 No
Vykuntarao
 
Answer
# 7
An adapter class is a class that provides a dummy (empty)
implementation for an interface. That way someone who wants
to implement the interface but does not want or does not
know how to implement all methods, can use the adapter class
instead, and only override the methods he is interested in.
 
Is This Answer Correct ?    7 Yes 0 No
Barkha
 
Answer
# 8
adapter class are simply the creation of event handler in
certain situation
 
Is This Answer Correct ?    12 Yes 9 No
Hardeep
 
Answer
# 9
we can create our classes as subclasses of one of
the adapter classes, then we need to override only some of
the methods we need. i.e, An adapter classes provide empty
implementation of all methods declared in an EventListener
interface.
 
Is This Answer Correct ?    2 Yes 0 No
Senthil
 
Answer
# 10
An adapter class is an implementation class of listener interface which contain all methods implemented with empty body.For e.g WindowAdapter is an adapter of WindowListener interface. Adapter class reduce overhead on programming while working with listener interface. 
Is This Answer Correct ?    2 Yes 0 No
Rajat Patel
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What is cloneable interface?   7
i need source code for income tax program using java inheritance   1
What are the allowed, non-Unicode letter characters that can be used as the first character of an identifier?   2
all are saying java doesn't support multiple inheritance but by default Object class is super class for all the user defined classes and we can extend atmost one class so each class can extend more than one class so java supports multiple inheritance?i am confused with this,pls any one explain me.   8
why operator overloading is removed in java?   1
what is difference between interface and abstract class..?   4
What is update method and when it is called? TCS 2
import java.io.*; class Demo { public static void main(String args[]) { File f=new File("1234.msg"); String arr[]=f.list(); System.out.println(arr.length); } } Ramco 3
write a simple program inheritance? Polaris 2
i need to know the site which compiles and run the java program completely in online... thank you for your reply in advance   2
How java is platform independent? TCS 41
Which are thin and thicK wrapper Class's in Java?   1
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com