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 is HashTable?

4 Answers  


Where is java located?

0 Answers  


why is multiple inheritance not allowed in java?

7 Answers   Elementus Technologies, Huawei, Infosys,


What is the main use of java?

0 Answers  


Is boolean a wrapper class in java?

0 Answers  


Explain listiterator and methods in listiterator?

0 Answers  


Can a main method be declared final?

0 Answers  


What will happen if static modifier is removed from the signature of the main method?

0 Answers  


Which is easier netbeans or eclipse?

0 Answers  


How do you read and print a string in java?

0 Answers  


How to overcome the exception object reference not set to an instance of object?

0 Answers   Wipro,


what is meta-Inf?

2 Answers   Polaris,


Categories