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 |
how to execute main()
What is replaceall in java?
What is scope & storage allocation of global and extern variables? Explain with an example
Write a java program to count the number of words present in a string?
What is the use of singleton class?
What is object
Define jre i.e. Java runtime environment?
What is contract between hashcode and equal method?
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters?
what is the life cycle of jsp?
What is the purpose of methodology?
What is loop in java?