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

os is developed in c no java is more secured then c na why dont the os developed is developed using java

1 Answers  


What is string length in java?

0 Answers  


Explain Stream Tokenizer?

4 Answers  


What is the difference between an argument and a parameter?

0 Answers  


What are the steps in the jdbc connection?

0 Answers  






Is java code slower than native code?

0 Answers  


How can we make sure main() is the last thread to finish in java program?

0 Answers  


What are the 3 types of control structures?

0 Answers  


What is an argument in java?

0 Answers  


Class A extends Class B but Class A also inherit Super Class Object so it is multiple inheritence give reason in support of your answer

3 Answers  


What are use cases?

0 Answers  


How many ways can you break a singleton class in java?

0 Answers  


Categories