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 |
I have a Person object with 5 variables and I want to store them in a file called Person.txt. What should I do?
How to perform merge sort in java?
Why are functions called methods in java?
When does the compiler supply a default constructor for a class?
How can you say java is object oriented?
What is pojo class in java?
What is the difference between Grid and Gridbaglayout?
What is the use of bufferedreader?
take any 4 input numbers. like 2345.. wanted out put is All 16 combinations of the number 2345.. for example- taking input as 4565 output- 5654 4556 4655..
What is thread priority?
whether java is fully object oriented language or partially object oriented language
How can you make a class serializable in java?