what is difference between abstraction and interface?

Answer Posted / kavitha

Abstract classes define methods and interfaces declare
methods.
Interfaces declare methods without implementation.
Abstract classes are very much useful when there is a same
functionality across various classes.
Interfaces are useful for classes which varies in
functionality and with the same method signature.

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between class & structure?

567


When will we prefer to use set and list in java and why?

546


What is var keyword ?

740


What is thread safe singleton?

515


What is substring in java?

617






What are static blocks and static initalizers in java ?

582


Can you achieve runtime polymorphism by data members?

583


Difference between ‘is-a’ and ‘has-a’ relationship in java?

538


How can we make copy of a java object?

544


What is multi-catch block in java?

616


What methods are used in Servlet?Applet communication?

1663


Difference between stack and queue?

585


How many JVMs can run on a single machine and what is the meaning of Just-In-Time (JIT) compiler?

753


How many types of methods are there in java?

525


Can static methods access instance variables in java?

573