XiYouJiRenWu
package com.hanqi.test;
public class XiYouJiRenWu {
String height,name,weapon;
XiYouJiRenWu(String h,String n,String w)
{
height=h;
name=n;
weapon=w;
}
String printName()
{
return name;
}
String printWeapon()
{
return weapon;
}
}
主类
package com.hanqi.test;
public class XiYOuJi {
public static void main(String[] args) {
XiYouJiRenWu m=new XiYouJiRenWu("","猴子","金箍棒");
System.out.println(m.printName());
System.out.println(m.printWeapon());
XiYouJiRenWu p=new XiYouJiRenWu("","猪","耙子");
System.out.println(p.printName());
System.out.println(p.printWeapon());
}
}