ObjectOriented Programming Wathinee Duangonnam FB AJ Wathinee Email
Object-Oriented Programming ������ Wathinee Duang-onnam FB : AJ Wathinee Email: wathinee. d@gmail. com
TOOL ������ q J 2 SE 32 bit http: //download. oracle. com/otn-pub/java/jdk/7 u 67 -b 01/jdk-7 u 67 windows-i 586. exe 64 bit http: //download. oracle. com/otn-pub/java/jdk/7 u 67 -b 01/jdk-7 u 67 windows-x 64. exe q eclipse https: //www. eclipse. org/downloads/ #
Class diagram q. Class q. Attribute(Data) q. Method Class Name Attribute. Name Method. Name ( ) #
[modifier] class ชอ Class { // Attribute_Member // Method_Member } public + ������ protected # private - class คอคยเวรดสำหรบกำหนดคลาส Class_Name คอชอคลาส Attribute_Member Data หรอขอมลในคลาส #
Rectangle rec; rec null stack Heap #
Rectangle rec; rec = new Rectangle(); Rectangle width=0. 0 new Rec tan gle( ); height=0. 0 rec 0 x 02 AB 257 stack Heap #
Rectangle rec = new Rectangle(); Rectangle width=0 new Rec tan gle( ); height=0 main } rec 0 x 02 AB 257 stack Heap #
Rectangle rec 1 = new Rectangle(); Rectangle rec 2 = new Rectangle(); Rectangle Width =0 Height =0 new main } rec 2 0 x 02 AB 334 rec 1 0 x 02 AB 257 stack (); e l ng a ct e R new Rectangle ; ) ( e l g n Recta Width=0 Height =0 Heap #
0. 0 new Rectangle(). width=3. 0; System. out. println("คาของ Width คอ "+new Rectangle(). width); new Rectangle() width=3. 0 Height=0. 0 new Rectangle() main width =0. 0 Height =0. 0 } stack Heap
������ Attribute ��� Class รปแบบท 2 )แนะนำใหใชวธน ( instance. ชอ Attribute; ตวอยาง Rectangle rec=new Rectangle(); rec. width; #
0. 0 Rectangle rec=new Rectangle(); System. out. println("คาของ Width คอ "+rec. width); rec. width=3. 0; System. out. println("คาของ Width คอ "+rec. width); e main } R new ; () e l g ctan 3. 0 =3. 0 width =0. 0 Heigth =0. 0 rec 0 x 02 AB 257 stack Heap #
Rectangle rec 1=new Rectangle(); 3. 0 rec 1. width=3. 0; 0. 0 System. out. println("คาของ Width คอ "+rec 1. width); Rectangle rec 2=new Rectangle(); System. out. println("คาของ Width คอ "+rec 2. width); new Rec tan gle (); width heigth } main rec 2 0 x 02 AB 247 rec 1 0 x 02 AB 244 stack new ); ( e l g n Recta width =3. 0 heigth Heap #
Rectangle rec 1 = new Rectangle(); Rectangle rec 2 = new Rectangle(); rec 2=rec 1; ��� Rectangle Re cta ngl e(); width height new Rectangle } main 0 x 02 AB 257 rec 2 0 x 02 AB 334 rec 1 0 x 02 AB 257 stack width height ; new Rectangle() Heap #
Rectangle rec 1 = new Rectangle(); Rectangle rec 2 = new Rectangle(); rec 2=null; ��� Rectangle width height a t c e w. R ; () e l ng Rectangle ne } main rec 2 0 x 02 AB 334 null rec 1 0 x 02 AB 257 stack new () e l g n Recta ; width height Heap #
- Slides: 35