OOA: Analysis + OOD: Design + OOP: Programming
==Object Oriented Features
1. encapsulation
2. Inheritance
3. Polymorphism
==Class and objects
1. default properties and methods are public
2. don't have to have constructor and disconstructor
3. object creation steps
step1: Person per=null; ==> per is on stack
step2: per = new Person(); ==> create object properties on heap
Note: method on globl instruction area when class created.
4. reference
Person per1 = new Person();
Person per2 = new Person();
Person per3 = per1;
per2 = per1; ==> the original object referred by per2 will be collected by java
没有评论:
发表评论