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 the advantages of packages in java?
Can a class be private?
Can we create an object of static class in java?
How do you use compareto?
Mention a package that is used for linked list class in java.
What is the difference between JVM and JRE?
How many boolean functions are there?
What does mean in regex?
What are the string methods in java?
Is it possible to define a method in java class but provide it’s implementation in the code of another language like c?
Is set thread safe java?
What is the purpose of static methods and variables?
Explain different forms of polymorphism?
is there a separate stack for each thread in java? : Java thread
Is oracle charging for java?