ALLInterview.com :: Home Page KalAajKal.com
 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                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
I have a class which is abstract which contains only the
abstract methods. This is similar to an interface. Then, if
 i have given a choice to choose one of them. Which one i
have to choose and why?
 Question Submitted By :: Shivaprasad Eppa
I also faced this Question!!     Rank Answer Posted By  
 
  Re: I have a class which is abstract which contains only the abstract methods. This is similar to an interface. Then, if i have given a choice to choose one of them. Which one i have to choose and why?
Answer
# 1
you never get a chance to choose a method from abstract 
class,because  if  you are writing a abstract class you 
have to provide implementation to all the methods in 
subclass otherwise you should declare that subclass as 
Abstractclass.
 
Is This Answer Correct ?    2 Yes 1 No
Harikrishna
 
  Re: I have a class which is abstract which contains only the abstract methods. This is similar to an interface. Then, if i have given a choice to choose one of them. Which one i have to choose and why?
Answer
# 2
Better to choose Abstract class. Because it contains not 
only the abstract methods but also implemented methods but 
in interfaces only unimplemented methods will be there and 
all final variables will be there.
 
Is This Answer Correct ?    0 Yes 1 No
Ashoka
 
 
 
  Re: I have a class which is abstract which contains only the abstract methods. This is similar to an interface. Then, if i have given a choice to choose one of them. Which one i have to choose and why?
Answer
# 3
i preferred to choose interface bcoz 
 if i implement interface still i have a chance to extend 
 another class
 
Is This Answer Correct ?    1 Yes 0 No
Venu
 
  Re: I have a class which is abstract which contains only the abstract methods. This is similar to an interface. Then, if i have given a choice to choose one of them. Which one i have to choose and why?
Answer
# 4
Interface is preferable to Abstract class as when ever in 
instance is created for subclasses of this,constructors 
will be called hirarchially consuming some time for each 
constructor call..
 
Is This Answer Correct ?    0 Yes 0 No
Madhav
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Default layout of Dialog object?  1
What is 3-tier model? Wipro3
what is the use of abstract class? AMDOC2
how to convert mm/dd/yy to dd/mm/yy using collections in java. Bosch2
What are the two ways you can synchronize a block of code? Ericsson3
Marker interface means , interface which has no methods.Then what is the necessity of its usage.I read "it tells the compiler that it should be treated differently ". "It is used to store state of an object". But still am not clear.Please explain clearly.  1
how can i connect to database in a applet ?  1
what is stringtolennizer with example? Symphony1
What is interface and its use? HCL6
What is the purpose of setAutoCommit() ? Google1
Name the methods that used to get and set the text label displayed by a Buttonobject?  1
What is the use of ?this??  4
Are nested try statements are possible?  2
What is the is a and has a relation ship in oops concept in java? BearingPoint5
Are there any tools available in java to create reports?  5
wht is mean by dirty read?  1
What is a deadlock ?  5
Can an object be garbage collected while it is still reachable?  2
How multi processing is achieved in JAVA? BMC4
What is the default modifier in Interface?  4
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com