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 methods are called, When we navigate from one applet to another applet?

1 Answers  


Can we override the static methods?

0 Answers  


How can a gui component handle its own events?

0 Answers  


Is hashmap thread safe?

0 Answers  


What is a static class in java?

0 Answers  






Explain Basics of OOP Language in java

0 Answers   Atos Origin,


Are floats faster than doubles?

0 Answers  


explain about casting of objects?

5 Answers  


What is an infinite loop? How infinite loop is declared?

0 Answers  


for(i=0;i<100;i++) { int i=method();//method returns no's from 1 to 10; /* insert some stmts which can give output like no.of times numbers(1-10) returned. (for example if it returns 2 then i want output how many times 2 returned) like that i want output for no's 1 - 10 how many times each no returned. */ }

3 Answers  


String is a immutable objects . it means that string does not change........... But it will be chang......... { String s="kapil"; String s1="raj"; String s=s1; then print(.......) The String has been changed .. how it is possible and why its called immutable objects

7 Answers  


What is method overloading in JAVA? Why is it not present in C ?

0 Answers   Akamai Technologies,


Categories