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 / ashwin khandelwal
It cannot be compiled because of weaker access privilege give to method in DerivedOne class while overidding method of Base Class
| Is This Answer Correct ? | 12 Yes | 0 No |
Post New Answer View All Answers
Will the compiler creates a default constructor if I have a parameterized constructor in the class?
Is it necessary that each try block must be followed by a catch block?
Implement 2 stacks with just 1 array. The stack routines must not indicate overflow unless every slot in array is used.
Explain the hierarchy of java exception classes?
What is arraylist e?
What is backdrop?
How to use string tokenizer class.
Can we convert list to set in java?
What does the string method compareto () do?
What is the difference between double and float variables in java?
What is an empty list in java?
What does substring mean?
How does regex work?
Can we create our own wrapper class in java?
What is a method declaration?