class A{
int i=10;
void get(){
System.out.println (i);
}
}
class B extends A{
int i=100;
void get(){
System.out.println (i);
}
public static void main(String h[]){
B a=new B();
a.get();
}
}
Output:
1. 10
2. 100
3. compile error
4. none
int i=10;
void get(){
System.out.println (i);
}
}
class B extends A{
int i=100;
void get(){
System.out.println (i);
}
public static void main(String h[]){
B a=new B();
a.get();
}
}
Output:
1. 10
2. 100
3. compile error
4. none
No comments:
Post a Comment