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 (1722)
 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 (147)
 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 default layout of JFrame class?   5
What modifiers are used with an inner class which is a member of an outerclass?   1
Explain the term serialization? Wipro 10
How u dubugg ur project? iFlex 1
how many ways we can serialize the java object? Satyam 2
diffrence b\w println() and printf() NIIT 8
Is there is any error if you have multiple main methods in the same class? Wipro 10
What classes can be used to store arbitrary number of objects ?   1
Scenario: There are 1 to 100 numbers. Each number should be keep in the each column like from A column to Z column ie 1 to 26. From 27 to 52 should be in 2nd row in the excel sheet. This has to be continue till 100. How do you write Java program and what are various methods. Cap-Gemini 2
Name the packages in JDK?   2
Which all r Final classes in java except string?   5
what is the logic inside any default constuctor?   2
 
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