when to use abstract class and when to use interface?

Answer Posted / surendra

Always prefer to interface until you are not sure the behavior
of operations.

chose the abstract class if you are sure for some common behaviors need to share of all objects.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by method?

574


Why scanner is used in java?

542


What do you understand by weak reference?

550


Explain the JDB in depth & command line.

565


What is meant by string is immutable?

515






Which collection is thread safe in java?

505


What is a vararg?

538


What is advantage of java?

535


Will the jvm load the package twice at runtime?

567


What is string example?

593


What is a prefix function.write down a code to compute prefix function.

532


If system.exit (0); is written at the end of the try block, will the finally block still execute?

610


What is the purpose of using javap?

609


Can we have multiple classes in single file ?

594


Is it possible to use string in the switch case?

549