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  >>  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
Difference between abstract class and Interfaces?
 Question Submitted By :: Bskumar78
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Difference between abstract class and Interfaces?
Answer
# 1
An Interfaces defines a public contract of methods for the
classes that implement it. An implementing class must
implement all the method defined by the interface.

An abstract class on the other hand not only defines a
public contract of methods but may also provide partial
implementation of some or all of the class methods. A
subclass of an abstract class inherits the partial
implementation (if any) or must provide a concrete
implementation of the abstract methods.
 
Is This Answer Correct ?    2 Yes 0 No
Ranganathkini
 
  Re: Difference between abstract class and Interfaces?
Answer
# 2
An abstract class can have concrete method, which is not 
allowed in an interface. Abstract class can have private or 
protected methods and variables and only public methods and 
variables are allowed in interface. We can implement more 
than one interface , but we can extend only one abstract 
class. Interfaces provides loose coupling where as abstract 
class provides tight coupling.
 
Is This Answer Correct ?    2 Yes 0 No
Nanthinikrishnan
 
 
 
  Re: Difference between abstract class and Interfaces?
Answer
# 3
•	Interfaces provide a form of multiple inheritances. 
A class can extend only one other class. 
•	Interfaces are limited to public methods and 
constants with no implementation. Abstract classes can have 
a partial implementation, protected parts, static methods, 
etc. 
•	A Class may implement several interfaces. But in 
case of abstract class, a class may extend only one 
abstract class. 
•	Interfaces are slow as it requires extra 
indirection to to find corresponding method in in the 
actual class. Abstract classes are fast.  
 
Is This Answer Correct ?    0 Yes 0 No
Taresh Nama
 
  Re: Difference between abstract class and Interfaces?
Answer
# 4
abstract is a class and its fulfilling while the subclass 
is extends the abstract class methods.
where as interface also a class it declare a methods.we 
must override all the methods at implements the interface.
 
Is This Answer Correct ?    0 Yes 0 No
Loganathan S
 
  Re: Difference between abstract class and Interfaces?
Answer
# 5
abstract class is the one which canhave both abstract as 
well as non abstract methods
Interface is the one which has all the methods are abstract
 
Is This Answer Correct ?    1 Yes 1 No
Ravikiran
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Why Java is not purely object oriented? Persistent21
what are the purposes of native, transiant key words?  2
How to print nodes of a Binary tree? TCS1
What is the difference between throw and throws?  5
How to do validation of the fields in any project ?  2
Real Time sample code for Encapsulation and Abstraction. where to use abstract and where to use specifies like public private.  1
could you run the java program without main method?  3
what is struts-config-xml?and its use?  3
What are hot spots in Java programming?  1
real time example for deadlock,starvation,livelock  4
How does a try statement determine which catch clause should be used to handle an exception?  2
Difference between Interface & Abstract class?  4
methods in Applet?  1
how you will prevent inheritance is there any other way other than inheritance? Wipro4
what are the different access specifiers that can be used by interfaces and abstract classes? can anyone give me detailed description on this  7
How do you load an HTML page from an Applet ?  2
Is it possible to create Userdefined Unchecked Exception also?If Yes, give an example?  2
for what purpose we use applets ? Mindlogicx2
What is meant by controls and types?  1
what is Portal(web based online portal)? AIG1
 
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