public class Parent {
private void print(){
System.out.println(" From Parent");
}
public static void main(
String args[]){
Parent p1 = new Parent();
p1.print();
p1 = new Chield();
p1.print();
}
}
class Chield extends Parent{
public void print(){
System.out.println(" From chield");
}
}
Output will be:
A. Compile error can't override the private method print()
B. From Parent
From chield
C. From Parent
From Parent
D. From chield
From chield
pls help me
my ans:B
ans given:C
help pls......
thanx
sherin