how you will prevent method overriding?

Answers were Sorted based on User's Feedback



how you will prevent method overriding?..

Answer / ravi

by declaring the method has a final

Is This Answer Correct ?    24 Yes 1 No

how you will prevent method overriding?..

Answer / neelam,noida

final method can not overridden

Is This Answer Correct ?    22 Yes 0 No

how you will prevent method overriding?..

Answer / ravikiran

bu marking the method final

Is This Answer Correct ?    13 Yes 1 No

how you will prevent method overriding?..

Answer / sumit

One can prevent method overriding by marking the method final. if you make a method static and reuse it in the subclass it will hide the the super class method. This is called method hiding rather than overriding.

Is This Answer Correct ?    6 Yes 0 No

how you will prevent method overriding?..

Answer / murali.25

you also prevent overriding by making the method static

Is This Answer Correct ?    3 Yes 6 No

how you will prevent method overriding?..

Answer / sonam

You can prevent method overriding by declared method as
static

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More Core Java Interview Questions

What is use of static method?

0 Answers  


What is default locale java?

0 Answers  


What are exception handling keywords in java?

0 Answers  


What is lazy activation?

2 Answers   CMC,


What are passing parameters?

0 Answers  






What are the two types of java?

0 Answers  


What is stop(), suspend(), resume() method?

3 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,


When is the garbage collection used in Java?

0 Answers   BirlaSoft,


Why there are some null interface in java? What does it mean?

0 Answers  


what is the difference between cd & dvd ?

30 Answers   Lovely Professional University, Satyam, Sibylsys,


What is regex used for?

0 Answers  


Categories