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 |
how to fing linkedlist is circular or not?
What is object-oriented programming?
wahts is mean by thread?
22 Answers HCL, TCS,
is it possible to instantiate the math class?
write a code, we have two thread, one is printing even no and other print the odd no.
What are exceptions
What one should take care of, while serializing the object?
Is java a security risk?
why we are calling j2se why not j1se or j3se or j4se..etc is there any reason.. can u please explain it... i shocked in my interview when they asked this question please explain ans
How do you print array in java?
What is the purpose of nested class in java?
Does a function need a return?