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

What are register variables what are the advantages?

441


How to split arraylist elements in java?

582


What is outofmemoryerror in java?

557


What is the difference between reader/writer and inputstream/output stream?

545


Is intellij better than eclipse?

531






What is data structure in java?

525


What is pass by value?

504


How many types of voids are there?

525


How do you decide when to use arraylist and linkedlist?

526


What if static is removed from main method?

562


How do you reverse a word in java?

522


Which collection is sorted in java?

537


what are three ways in which a thread can enter the waiting state? Or what are different ways in which a thread can enter the waiting state? : Java thread

512


What is string :: npos?

567


How many types of equations are there?

533