I have a class which is abstract which contains only the
abstract methods. This is similar to an interface. Then, if
i have given a choice to choose one of them. Which one i
have to choose and why?

Answer Posted / madhav

Interface is preferable to Abstract class as when ever in
instance is created for subclasses of this,constructors
will be called hirarchially consuming some time for each
constructor call..

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?

782


Why Java is not pure Object Oriented language?

861


What is integer valueof?

847


Can we use return in constructor?

674


What is run time allocation?

768


What is the difference between static and global variables and also define what are volatile variables?

792


Can an interface have a class?

749


What is the difference between import java.util.date and java .util?

803


What is java and their uses?

747


Difference between final and effectively final ? Why is effectively final even required ?

751


How to handle a web browser resize operation?

743


Is java se open source?

757


how we can make a write-only class in java?

758


Given a singly linked list, determine whether it contains a loop or not without using temporary space?

753


What are pass by reference and pass by value?

700