how you will prevent inheritance is there any other way
other than inheritance?

Answers were Sorted based on User's Feedback



how you will prevent inheritance is there any other way other than inheritance?..

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

how you will prevent inheritance is there any other way other than inheritance?..

Answer / marx

If you declare the class as a final,we cant inherit the
class.

Is This Answer Correct ?    5 Yes 3 No

how you will prevent inheritance is there any other way other than inheritance?..

Answer / ravikiran

my marking the class as final

Is This Answer Correct ?    1 Yes 0 No

how you will prevent inheritance is there any other way other than inheritance?..

Answer / yugank

Association

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Core Java Interview Questions

What are the object and class classes used for?

0 Answers  


Which programming language is most secure?

0 Answers  


For class CFoo { }; what default methods will the compiler generate for you>?

0 Answers   Amazon,


How we can skip finally block of exception even if some exception occurs in the exception block in java?

0 Answers  


Enlist diffrent types of inheritance supported by java?

0 Answers  






what is mean by method signature?

5 Answers   Satyam,


What is exception in java?

0 Answers   Cyient,


Can we use both this () and super () in a constructor?

0 Answers  


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?

1 Answers   CMC,


What is java util collection?

0 Answers  


relation between list and linked list

1 Answers   Infosys,


Categories