| 問題4-12 |
|---|
次のプログラムをコンパイルし、実行するとどうなりますか。正しいものを選択してください。(1つ選択)
public class Parent{
public void method(int i){
System.out.println("Parent Value : " + i);
}
}
public class Child extends Parent{
public void method(int i){
System.out.println("Child Value : " + i);
}
}
public class Sample{
public static void main(String[] args){
Parent p = new Parent();
Parent c = new Child();
p.method(10);
c.method(20);
}
}
|