oop person&body

public class person {
    BloodType bloodtype;
    enum BloodType{A,B,O};
    String FirstName, LastName;
    String BirthDay;
    Body body;
}
abstract class part{
    float weight;
    void setWeight(float w){ weight = w;}
    float getWeight(){  return weight;}
}
class Body{
    Arm[] arms;
    Head head;
    Leg[] legs;
}
class Arm extends part{}
class Head extends part{}
class Leg extends part{}

 

posted on 2013-08-21 07:03  brave_bo  阅读(140)  评论(0)    收藏  举报

导航