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 is the default modifier in Interface?
What is an object in java and how is it created?
what is mean by synchronization?
3 Answers BOB Technologies, GCPL,
What are the different types of collections in java?
What are serialization and deserialization?
How would you format a date in java? I.e. In the ddmmyyy format?
What are static blocks and static initalizers in java ?
Why main() method is public, static and void in java ?
what is a static block?
How many types of interfaces are there?
How do singleton patterns work?
Can you add null to a list java?