how you will prevent method overriding?
Answers were Sorted based on User's Feedback
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 |
Answer / murali.25
you also prevent overriding by making the method static
Is This Answer Correct ? | 3 Yes | 6 No |
Answer / sonam
You can prevent method overriding by declared method as
static
Is This Answer Correct ? | 0 Yes | 4 No |
What methods are called, When we navigate from one applet to another applet?
Can we override the static methods?
How can a gui component handle its own events?
Is hashmap thread safe?
What is a static class in java?
Explain Basics of OOP Language in java
Are floats faster than doubles?
explain about casting of objects?
What is an infinite loop? How infinite loop is declared?
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. */ }
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
What is method overloading in JAVA? Why is it not present in C ?
0 Answers Akamai Technologies,