色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

Java創建如下類和子類

錢斌斌2年前24瀏覽0評論

Java創建如下類和子類?

class Human{

public String IdCard;

public String Name;

Human(String ic,String Nam){

IdCard=ic;

Name=Nam;

}

void CanSpeak(){};

}

class Man extends Human{

String kind="Man";

Man(String ic, String Nam) {

super(ic, Nam);

}

void CanSpeak(){

System.out.println(Name+" "+kind+" "+IdCard+" can speak English");}

}

class Woman extends Human{

String kind="Woman";

Woman(String ic, String Nam) {

super(ic, Nam);

}

@Override

void CanSpeak(){

System.out.println(Name+" "+kind+" "+IdCard+" can speak Chinese");}

}

public class Test{

public static void main(String agrs[]){

Man m=new Man("1111","張三");

Woman w=new Woman("2222","小紅");

Human h=m;

m.CanSpeak();

w.CanSpeak();

h.CanSpeak();

}

}

java子類,Java創建如下類和子類