public class Test1 {
public static void main(String[] args) {
}
public void add(){
}
}
class Test2 extends Test1 {
private void add(){
}
}
Compile time error :
Cannot reduce the visibility of the inherited method from Test1
public static void main(String[] args) {
}
public void add(){
}
}
class Test2 extends Test1 {
private void add(){
}
}
Compile time error :
Cannot reduce the visibility of the inherited method from Test1
No comments:
Post a Comment