(7-7)阅读程序,写出程序运行结果。 // 写出程序运行结果 class Leg { // 腿 private int length ; public Leg( int length ) { this . length = length ; } public int getLength() { return length ; } public void setLength( int length ) { this . length = length ; } } class Head { // 头 private String type ; // 类型 public Head(String type ) { this . type = type ; } public String getType() { return type; } public void setType(String type ) { this . type = type ; } } class Person { private String name ; // 姓名 private char sex ; // 性别 private Leg leg ; // 腿 private Head head ; // 头 public Person(String name ) { this . name = name ; } public Person(String name , char sex ) { this ( name ); this . sex = sex ; } public Leg getLeg() { return leg ; } public void setLeg(Leg leg ) { this . leg = leg ; } public Head getHead() { return head ; } public void setHead(Head head ) { this . head = head ; } public String getPerson() { StringBuffer sb = new StringBuffer(); sb .append( this . name + leg .getLength()+ head .getType()); return sb .toString(); } } // 测试类 public class DogDemo { public static void main(String[] args ) { Leg leg = new Leg(30); Head head = new Head( " 国字脸 " ); Person zhangfei = new Person( " " , ' 男 ' ); zhangfei .setLeg( leg ); zhangfei .setHead( head ); leg .setLength(80); System. out .println( zhangfei .getPerson()); } }