When we will use an Interface and Abstract class?

Answer Posted / debapriya patra

Interface:
Through interface we get the multiple inheritance
in java.And we implement interfaces to override the
abstract methods it contains.


Abstract class:

We also use abstract classes to override the
abstract methods that it contains.Otherwise the child class
will mentioned as abstract.

If we wants to prevent a class from instantiation then we
mentioned it as abstract.

Is This Answer Correct ?    25 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is command line used for?

820


Is linked list a linear or non-linear data structure?

737


Can we have multiple catch block for a try block?

782


What is type safety in java?

722


What is composition in java?

948


What is update method called?

874


What are the advantages of java over C++?

924


How do I know if java is installed?

778


what is meant wrapper classes?

823


What are the 4 versions of java?

852


What is the exact difference in between Unicast and Multicast object? Where will it be used?

797


Why map is used in java?

792


What is final class?

782


What is the best way to findout the time/memory consuming process?

785


What is finalize method?

815