作者:广东在线游戏网日期:
返回目录:游戏资讯
woman 是不同类的
因为其他几个单词就是对亲属的称呼一类的,而woman不是
class Parents
{
String name;
int age;
public Parents()
{
}
public void getinfo()
{
System.out.print("我的名字是"+name+",");
System.out.println("我的年龄是"+age+",");
}
public void setinfo(String name,int age)
{
this.name=name;
this.age=age;
}
public void print()
{
System.out.print("我是家长"+",");
getinfo();
}
}
class Father extends Parents
{
String interest;
public void print()
{
System.out.print("我是父亲"+",");
super.getinfo();
System.out.println("我的爱好是"+interest);
}
}
class Mother extends Parents
{
String haircolor;
public void print()
{
System.out.print("我是母亲"+",");
super.getinfo();
System.out.println("我的头发颜色是"+haircolor);
}
}
class TestParents
{
public static void main(String[] args)
{
Parents pa=new Parents();
pa.setinfo("王瑞7a64e4b893e5b19e365",36);
pa.print();
Father fa=new Father();
fa.interest="打保龄球";
fa.setinfo("张峰",45);
fa.print();
Mother mo=new Mother();
mo.haircolor="棕色";
mo.setinfo("孙娟",36);
mo.print();
}
}
你好!
是he ,它是人称代词;其它两个是名词。