how you will prevent inheritance is there any other way
other than inheritance?

Answer Posted / raju

One way to prevent inhertance is final class
2) Using private Constructor in a class we can prevent
inhertance[Single ton class ]
Alternate of in hertance are
delegation,composition, aggrigration etc..

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

'A class is a template for an object' explain this statement.

558


What are the three parts of a lambda expression?

544


What is the difference between preemptive scheduling and time slicing in java programming?

546


Explain about doubly linked list

632


Name some classes present in java.util.regex package.

616






State the difference between strings and arrays.

612


What is bool mean?

577


What are java packages? What is the significance of packages?

579


What is the difference between an interface and an abstract class?

548


Name few "optional" classes introduced with java 8 ?

659


What is variable and example?

527


Can we use string in the switch case?

590


What are different types of classloaders?

598


What is the concept of multithreading?

530


What is the right data type to represent a price in java?

580