- World's Largest Collection of Interview Questions
Start Your Own website Now
Sponsored Links

Interview Questions
Our Services

Get 9,000 Interview Questions & Answers in an eBook.

  • 9500+ Pages
  • 9000 Question & Answers
  • All Tech. Categories
  • 14 MB Content

    Get it now !!

    Send your Resume to 6000 Companies

    Question :
    What is similarities between an Abstract class and Interface?
    Category Core Java Interview Questions
    Rating (0.4) By 2156 users
    Added on 8/24/2009
    Views 1815
    Rate it!

    Neither Abstract classes or Interface can be instantiated.

    We can't create a object of both Interface and Abstract class.
    We create object of the class who inherit either abstract class of interface.

    Posted by: Ajay Kumar Sharma    

    Contact Ajay Kumar Sharma Contact Ajay Kumar Sharma

    abstract methods are contained in both interface and abstract classes.
    Neither abstract classes nor interface can be instantiated
    we create object for the class which implements abstract class or interface

    Posted by: Efzel    

    Contact Efzel Contact Efzel

    In java abstract class can have abstract methods and non abstract methods.But if we have atleast one abstract method in a class then the compiler will force the user to make the class as abstract. We can just make an class having all concrete methods as abstract also ( kind of privacy setting ) so no one will instantiate an object of that class. An interface in java is like a contract between the interface and the class which implements it . In an interface all the methods are public abstract and all the variable are public static final . An interface can never have a concrete method. An interface basically acts as a design pattern also ( like factory design pattern) best example is the JDBC api's Connection , statement , resultset all are interfaces so decoupled architecture is created and helps the application to be saclable and maintainable.

    Posted by: Mahanth Hiremath    

    Contact Mahanth Hiremath Contact Mahanth Hiremath

    In Java is contain the both abstract and interface class,in both of the class,similarity is unimplemented method..but if we want to implement that method means...we have to use without using abstract and interface keyword,we can implement.

    Posted by: Pranesh Rao    

    Contact Pranesh Rao Contact Pranesh Rao

    If you have the better answer, then send it to us. We will display your answer after the approval.
    Rules to Post Answers in

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
    Inform me about updated answers to this question

    Related Questions
    View Answer
    What is Collection API?
    View Answer
    What do you understand by Synchronization?
    View Answer
    What is transient variable?
    View Answer
    What is a local, member and a class variable?
    View Answer
    What are wrapped classes?
    View Answer
    What does it mean that a method or field is ?static??
    View Answer
    What modifiers are allowed for methods in an Interface?
    View Answer
    Why operator overloading is not there in java?
    View Answer
    What modifiers are allowed for methods in an Interface?
    View Answer
    What is a local, member and a class variable?
    View Answer

    Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here - Best Freshers & Experienced Jobs Website.

    View ALL Core Java Interview Questions

    User Options
    Sponsored Links

    Copyright ©2003-2015, All Rights Reserved.
    Privacy Policy | Terms and Conditions

    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Dedicated Servers | C Interview Questions & Answers

    Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes

    Cache = 0.062012 Seconds