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 the default value of an object reference declared as an instance variable?

0 Answers  


What happens if we override private method?

0 Answers  


How core java/j2ee project performance can be measured ?

1 Answers  


What are java packages? What's the significance of packages?

0 Answers  


What is package protected in java?

0 Answers  


How many static init can you have?

0 Answers  


What does g mean in regex?

0 Answers  


How Applets & Servlets will communicate with each other?

2 Answers  


what is the difference between Object Based Language and Object Oriented Language?

0 Answers   Aspire,


what is unreachable code problem in multiple catch statements

3 Answers  


Is minecraft java edition free?

0 Answers  


What is variable explain?

0 Answers  


Categories