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                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Advanced 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
In real time project when will we use Abstract class. and
what are the difference between abstract and interface.
 Question Submitted By :: Gkunta
I also faced this Question!!     Rank Answer Posted By  
 
  Re: In real time project when will we use Abstract class. and what are the difference between abstract and interface.
Answer
# 1
abstract class means--it has atmost one abstract
method.remaining  might be abstract or not.

interface means ---it has almostall abstract methods.u have
only the method specification.

In real time if u want to share the some common features in
the abstract class  u have to extends the abstract class.
so, u need not wrote the body to the all the methods.
if u implement  interface u should  write body to the all
the methods.
 
Is This Answer Correct ?    1 Yes 0 No
Gopi
 
  Re: In real time project when will we use Abstract class. and what are the difference between abstract and interface.
Answer
# 2
In real time when u extend Abstract class no need t provide 
implementation f all methods & it contains one abstract 
method remaining al r concrete methods
whereas interface we have t provide implementation f all 
methods & by default al r abstract methods
 
Is This Answer Correct ?    1 Yes 0 No
Satish
 
 
 
  Re: In real time project when will we use Abstract class. and what are the difference between abstract and interface.
Answer
# 3
Depending upon the requirement.

Abstract class---->it contains zero or more abstract methods.

ex HttpServlet and GenericServlet
HttpServlet contains all sre concrete methods but it
declared as a Abstract class.

InterFace--->It contains all abstract methods.

if we extends the abstract class .there is chance to extend
another class.

if we implements the interface we can extends another class
 
Is This Answer Correct ?    1 Yes 0 No
Aravind
 

 
 
 
Other Advanced Java Interview Questions
 
  Question Asked @ Answers
 
What is MOM? Wipro1
How can a dead thread be restarted? Wipro1
Can you write Java code for declaration of multiple inheritance in Java ? Oracle4
can any one tell me how to learn good coding techniques  3
Differences between applications and applets?  3
Connection Pooling with different type of databases?  1
Can a thread be a member of another thread?  1
What method MUST be implemented by all threads?  1
diff vector arraylist Saka-Solutions2
what is stringBuffer and StringBuilder?  1
What is multithread synchronizing ? Sun-Microsystems3
difference between sql exception class and sql warning class  1
What is the use of Class.forName HCL8
What will happens, when a thread cannot acquire a lock on an object?  2
Explain Object Serialization and it can be used? Infosys1
How two threads will communicate with each other?  1
what is Static binding? Wipro2
diff mvc1 and mvc2 wahts is mean by servlet chaining? SolutionNET3
What are skeletons and stubs and how they are generated?  2
What is runnable?  1
 
For more Advanced 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