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

How can you make sure that your singleton class will always return single instance in multi-threaded environment?

539


What is member in java?

468


What is sorting in java?

508


What are the rules for naming an array?

498


What is the difference between variable & constant?

516






What is difference between == and === in js?

529


Explain about strings in java?

595


What is the difference between the size and capacity of a vector?

546


In java, how we can disallow serialization of variables?

530


Is a char always 1 byte?

481


What are the string methods in java?

559


What is operator overloading. Is it is supported in java?

501


What is keyword auto for?

618


What is the transient keyword?

601


How many types of memory areas are allocated by jvm?

535