public class Base {
public void myMethod(int a,intb) {}
}
// Uses myMethod and then hides it.
public class DerivedOne extends Base {
private void myMethod(int a,int b);
}
will this compile or not .yes or no. why
Answer Posted / narayana
This will not compile because in the base class myMethod()
function is not having the body ,only abstract methods
should not have the body remaining all methods should have
the body
| Is This Answer Correct ? | 6 Yes | 6 No |
Post New Answer View All Answers
What are pass by reference and pass by value?
What is substring in java?
What is the difference between the size and capacity of a vector?
What is final class?
What is predicate in java?
What is a parent class in java?
Which is the best sorting technique in java?
What does mean in regex?
Are primitives objects?
Why synchronization is important?
Which is easier .net or java?
How will you serialize a singleton class without violating singleton pattern?
What are inbuilt functions in java?
Can we use switch statement with strings?
How to avoid memory leak in java?