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

how to execute main()

4 Answers   Symphony, TCS,


What is replaceall in java?

0 Answers  


What is scope & storage allocation of global and extern variables? Explain with an example

0 Answers   IBS,


Write a java program to count the number of words present in a string?

0 Answers  


What is the use of singleton class?

0 Answers  






What is object

6 Answers  


Define jre i.e. Java runtime environment?

0 Answers  


What is contract between hashcode and equal method?

0 Answers  


How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters?

0 Answers  


what is the life cycle of jsp?

3 Answers   Photon,


What is the purpose of methodology?

0 Answers  


What is loop in java?

0 Answers  


Categories