11 构造方法和垃圾回收.pptxVIP

  • 0
  • 0
  • 约1.65千字
  • 约 44页
  • 2021-01-07 发布于安徽
  • 举报
;Stack and heap;;;;;Instance variables;3 steps of object declaration, creation and assignmengt;;Constructor;Initializing the state of a class;;;;;;;Inheritance and constructors;;;How to invoke a superclass constructor?;;The superclass parts of an objects have to be fully-formed (completely build) before the subclass parts can be constructed. The call to super() must be the first statement in each constructor.;Superclass constructor with arguments;Invoking one overloaded constructor from another;;How long does an object live?;;;;;;;Initialization with inheritance;;;;;;monitor.expect(new String[] { Creating Characteristic is alive, Creating Description Basic Living Creature, LivingCreature(), Creating Characteristic has heart, Creating Description Animal not Vegetable, Animal(), Creating Characteristic can live in water, Creating Description Both water and land, Amphibian(), Creating Characteristic Croaks, Creating Description Eats Bugs, Frog(), Bye!, Frog dispose, finalizing Description Eats Bugs, finalizing Characteristic Croaks, Amphibian dispose, finalizing Description Both water and land, finalizing Characteristic can live in water, Animal dispose, finalizing Description Animal not Vegetable, finalizing Characteristic has heart, LivingCreature dispose, finalizing Description Basic Living Creature, finalizing Characteristic is alive }); ;;;;Behavior of polymorphic methods inside constructors

文档评论(0)

1亿VIP精品文档

相关文档