when to use abstract class and when to use interface?

Answer Posted / muthusenthil

Abstract(patially implemented) class can be used as a
common base class for an application it has all property of
class except it cannot be instantiated.it provide default
behavior.

interface is mearly a specification,nothing implemented for
any standalone project which can be changed at will its
more design flexible and it can be utilized to model
multipleinheritance.

Is This Answer Correct ?    56 Yes 30 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a class declared as private be accessed outside it’s package?

501


Explain java coding standards for methods?

593


What is collection class in java? List down its methods and interfaces.

516


What is the difference between object oriented programming language and object based programming language?

549


Why object class is super class for every class in java?

555






What is array length in java?

515


Why is a string immutable?

531


What is method overloading in java ?

548


What is an infinite loop? How infinite loop is declared?

558


Does java support multiple inheritance or not?

593


Write an algorithm program in java for the following question.. 1) S is a set of integers.X is an integer obtained by sum of two digits in S. Write logic for whether or not the X is from the S. The time of algorithm should not exceed o(n logn).

1590


Compare java and python.

567


What is int argc char * argv?

558


How do you create a reference in java?

504


Is sizeof a preprocessor?

534