正在加载图片...
I package demo.saint; 1 package demo.saint; 3 Import java.ut1l.LinkedList; 3 public class People 4 4 protected String name; 5 public abstract class Saint extends People 5 private final String level; protected string gender; private String constellation; 6 protected int age; protected int height; private Armer armer; 8 public void walk(){ 1 package demo.saint; System.out.printIn(name+ nkedList<Skill>(); 0 2 String gender,int age,int height)( 19 public void talk(String msg){ 3 public class Main System.out.println(name+"s 4 3 59 public static void main(String[]args){ 4= public People(String name,Strin 6 BronzeSaint x1ngsh1=new BronzeSa1nt("星矢","M",16,165) this.name-name; > xingshi.setConstellation("天马"): the arner "armer.getconstellation()); 6 this.gender-gender; this.age=age; Armer tm_armer=new Armer("天马")i 8 9 this.heightsheight; xingshi.setArmer(tm_armer); 19 xingshi.setMicrocosm(10000): 1 package demo.saint; 星矢has armed the armer天马 3 public class Armer( 4 private String constel 5 public Armer(String cc 星矢learned the skil1天马流星拳 6 this.constellatior k111.getName()); public String getconst 星矢learned the skill 天马彗星拳 9 return this.conste 11 星矢perform天马流星拳to majun package demo.saint; 2 38 System,out.printin(name+"pertorm -+sk111.getName()+"to "+target.nane); 3 public class BronzeSaint extends Saint 39 Yelse System.out.println(nane+"does not have the skill "+skil1.getName()); 5 public BronzeSaint(String name,String gender,int age,int height){ 41 42 6 super("Bronze",name,gender,age,height); 43 public String getconstellation(){ 7 44 return constellation; 45 9 6 public void setConstellation(String constellation){ 47 this.constellation constellation; 4 1 49 public String getLevel(){ return level; 52
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有