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
How do you escape a string?
What is the reason behind using constructors and destructors?
What is a classloader in java?
What is the difference between hashmap and hashtable in java?
What is a stringbuffer?
Explain public static void main(string args[]).
What is native method in java?
What is a line separator in java?
What is join () in java?
What is java and why do we need it? Explain
Can we override the static methods?
What is downcasting?
How is string immutable in java?
What is the purpose of the runtime class in java programming?
Why do we need data structure in java?