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
'A class is a template for an object' explain this statement.
What are the three parts of a lambda expression?
What is the difference between preemptive scheduling and time slicing in java programming?
Explain about doubly linked list
Name some classes present in java.util.regex package.
State the difference between strings and arrays.
What is bool mean?
What are java packages? What is the significance of packages?
What is the difference between an interface and an abstract class?
Name few "optional" classes introduced with java 8 ?
What is variable and example?
Can we use string in the switch case?
What are different types of classloaders?
What is the concept of multithreading?
What is the right data type to represent a price in java?