how you will prevent inheritance is there any other way
other than inheritance?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / marx
If you declare the class as a final,we cant inherit the
class.
| Is This Answer Correct ? | 5 Yes | 3 No |
What is backdrop?
Explain the difference between arraylist and linkedlist in java?
How do you escape a string?
What is difference between core java and java ee?
Can we declare a class as static?
What is the use of isempty in java?
why we cannot declare static variable inside a static method
How to set the Heap size in Java ?
What is the latest version of java?
How will you load a specific locale?
What is gc()?
Explain role of constructor in a java application?