Object OrientedProgramming)    OOP
object                          request)         object        operation)- Program                 object         message)...
Object 2                          dataObject 1 data                              Object 4                               da...
object        data                           method                        template)     Object)Object               Objec...
Object            Object                             identity             Attribute(Variable) State                   Obje...
Encapsulation -                              methodspropertiesInheritance -                           subclass)Abstraction...
Encapsulation)                   private         public              get/setdata              class        Full Encapsulat...
Inheritance)           Class                   Class                       Class- ClassSubclasses- Class                  ...
- Overridden method- Dynamic Binding                             OOP  Object             class     main>>                 ...
object     class                      class    object>>                                 object      object 1object 2     c...
บทที่ 6 คลาสและการเขียนโปรแกรม
บทที่ 6 คลาสและการเขียนโปรแกรม
Upcoming SlideShare
Loading in …5
×

บทที่ 6 คลาสและการเขียนโปรแกรม

279 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
279
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

บทที่ 6 คลาสและการเขียนโปรแกรม

  1. 1. Object OrientedProgramming) OOP
  2. 2. object request) object operation)- Program object message) message request function object- Objectobject object object- Object type/class)
  3. 3. Object 2 dataObject 1 data Object 4 data Object 3 data Object Message Object
  4. 4. object data method template) Object)Object ObjectAttribute) Object Behavior)
  5. 5. Object Object identity Attribute(Variable) State Object ObjectMessage State Attribute (Value ofAttribute) Behavior Object Object
  6. 6. Encapsulation - methodspropertiesInheritance - subclass)Abstraction - objectPolymorphism - method
  7. 7. Encapsulation) private public get/setdata class Full Encapsulationclass
  8. 8. Inheritance) Class Class Class- ClassSubclasses- Class Superclass Reusable)Class Superclass Class Single Inheritance) extends
  9. 9. - Overridden method- Dynamic Binding OOP Object class main>> object x>> class object class x { public static void main(String args[]) { System.out.println("x");
  10. 10. object class class object>> object object 1object 2 class x { public static void main(String args[]) { int i = 1; System.out.println(i); ok(); } static void ok() { System.out.println("xx"); } }// Result of this program// 1// xx

×