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 |
Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?
how to transactions(Bank transactions) in business process in ejb?
Difference between this() and super() in java ?
Which are the two subclasses under exception class?
What is meant by Java interpreter?
Outline the major features of java.
What does += mean coding?
Explain the significance of class loaders in bootstrap?
What are inbuilt functions?
What is a package in java? List down various advantages of packages.
class A { private int i; } class B extends A { private int i; } if I create an object of B class what will be the memory of that object.
What are the differences between graph and tree?