2011年12月29日星期四

第9天第1节: 继承的基本概念

==Syntax
    class Base {
         ....
    }
    class Drived extends Base {
         ....
    }

==Usage:
    -adding new properties and methods
    -overriding base properties and mehtods

==Note:
    -no-argument construct of base class is called automatically, can called explicitly by super();
    -has-argument constract of base class must be called explicitly at the first line of constructor of derived class
    -derived class can extends only one base class
    -derived class can only access public member and method of base class

没有评论: