when to use abstract class and when to use interface?

Answer Posted / brijendra kumar soni(xavient)

1-By using Interface we can achieve the Multiple
inheritence while by using abstract class we can not
achieve.

2-Abstract Class extended by a class only while Interface
implmented by a class and extended to one or more
interfaces.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is native code?

745


Explain Basics of OOP Language in java

797


How do you define a singleton class?

791


Which one of the following suits the description of a string better: derived or primitive?

736


What is static data type in java?

775


What is the console in java?

906


Is static variable stored in heap?

712


What is this keyword in java?

802


What is the purpose of static methods and static variables?

764


What are the differences between path and classpath variables?

761


What is keyset in java?

843


How do you implement polymorphism in our day to day life?

2971


Can we pass null as argument in java?

705


Why do we need singleton?

748


How do you achieve polymorphism in java?

724