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 are the object and class classes used for?
Which programming language is most secure?
For class CFoo { }; what default methods will the compiler generate for you>?
How we can skip finally block of exception even if some exception occurs in the exception block in java?
Enlist diffrent types of inheritance supported by java?
what is mean by method signature?
What is exception in java?
Can we use both this () and super () in a constructor?
Can we declare an anonymous class as both extending a class and implementing an interface?
8 Answers College School Exams Tests, JVA, TCS, Wipro,
what is difference between prepare stetement and callable starement with example?
What is java util collection?
relation between list and linked list