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
What is the difference between abstract class and interface?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the difference between abstract class and interface?
Answer
# 1
An interface is purely contractual in that it only defines
method headers but no implementation. Classes that implement
the interface must provide implementation to all method
defined by the interface.

An abstract class contains partial implementation, i.e. it
provides implementation for some methods where as just
defines abstract method headers for other. Abstract classes
cannot be instantiated directly and have to be extended by
subclasses who implement the abstract methods defined in the
abstract superclass. Unlike an interface, subclasses of the
abstract class only need to implement only those methods
that are marked abstract.
 
Is This Answer Correct ?    3 Yes 0 No
Ranganathkini
 
  Re: What is the difference between abstract class and interface?
Answer
# 2
A programer uses an abstract class when there are some 
common features of the program shared by all the objects.
A programer uses an interface when all the features of the 
program are implements differently for different objects.
 
Is This Answer Correct ?    2 Yes 1 No
Venu
 
 
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
heavy components means what?  4
What are the OOPS concepts in Java ? Satyam3
What is operator?  2
What is the difference between Stream Reader and Stream Writer?  4
What is non static block in java Ness-Technologies6
explain the clone method and clonable interface  1
Hai all I want to print given array in reverse order Ex: int a[]={1,2,3,4,5};display this array in reverse order.  2
What is the difference between overloading and overriding a function? Infosys7
How to find the length and capacity of a string buffer ?  2
strings in java are objects.why?  2
can abstract class have constructor how can you achive this ? Fidelity3
What is the return type of a program?s main() method?  2
how to use finalize()Method to resources TCS2
What are the ways of polymorphism other than Overridding & Overloading  1
What is the use of Getters and Setters method ?  2
can we Connect Applet to Data Base ? with Discriptiom. and also What is Diff. from Applet & Servlet? Systematix1
Functionality of JVM? Infosys4
What is unicode?  2
explain System.out.println() CTS7
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?  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