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 does index mean in java?
How do you pass by reference?
What is the purpose of void?
What are the two ways to create a thread?
Define jit compiler?
What is math floor in java?
What is the use of put method?
When do you get classcastexception?
How does list work in java?
String class is defined under which package in java?
What is the difference between final, finally and finalize()?
Will set allow duplicates in java?
What method is used to specify a container's layout in java programming?
Can we override the static method?
Does .length start 0 java?