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 |
can two class in a code be public??if yes then how??
What is better - 'bit-shift a value' or 'multiply by 2'?
i need source code for income tax program using java inheritance
What is Collections API?
how can i cal servlet from jsp page?how can i pass variablesfrom the jsp that servlet can access?
What is increment in java?
as we know a static method could access static data and static method only. then how could main method call the object of aclass which is not static and other non static data
How Array List can be Serialized.
What is the middleware?
What is Hierarchy of exception?
what is servlet enginee?
What is a treeset in java?