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 is visibility mode?
Is integer immutable in java?
Can you use abstract and final both with a method?
How to change value in arraylist java?
What is hash code collision?
What is the public method modifier?
When a byte datatype is used?
What are the four corner stones of oop?
Write code to implement bubble sort in java?
These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }
What does it mean that a class or member is final?
what is session in java?
Why does java have two ways to create child threads? Which way is better?
What do you understand by the term string pool?
What is tostring () method?