Can a class extend abstract class or interface? why

Answer Posted / abhay bhatia

a class can extend an abstract class and can implement an
interface, why is because even though an abstract class
provide default implementation of its methods, we cannot
instantiate an object of the abstract class and therefore
need a class that extends it to use the instance methods of
this abstract class. An interface on the other hand cannot
even have default implementation, therefore it has to be
implemented to be used

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?

776


What are the different ways of creating thread?

805


what methods would you overwrite in java.lang.object class?

777


How do you create a sop?

748


Explain the public class modifier?

731


What is the purpose of default constructor?

799


Is char a method in java?

764


Can you pass functions in java?

797


What are the two types of streams offered by java 8?

706


Differentiate between == and equals().

805


What are some alternatives to inheritance?

841


What is difference between core java and java ee?

697


What do you understand by the term polymorphism?

844


What is the exact difference in between Unicast and Multicast object?

1787


What is the static method?

775