单项选择题

请选出正确答案
class Parent {
     String one, two;
     public Parent(String a, String b){
        one = a;
        two = b;
     }
    public void print(){ System.out.println(one); }
}
public class Child extends Parent {
      public Child(String a, String b){
        super(a,b);
      }
      public void print(){ 
           System.out.println(one + " to " + two);
      }
      public static void main(String arg[]){
           Parent p = new Parent("south", "north");           
           Parent t = new Child("east", "west");
           p.print();
           t.print();
      }
}

A.south
east to west
B.south to north
east to west
C.south to north
east
D.Cause error during compilation.
微信扫码免费搜题