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
Why singleton is not thread safe?
What about interthread communication and how it takes place in java?
What are the types of java?
Why is inheritance used in java?
What is break and continue statement?
How many types of flags are there?
Why are lists ordered in java?
What is the difference between multiple processes and multiple threads?
Can we use String with switch case?
What is a copy constructor in java?
Is arraylist ordered?
Explain about instanceof operator in java?
If a class is declared without any access modifiers, where can the class be accessed?
Is integer passed by reference in java?
can used Protected Class outside Function.?