Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Chapter1 Introduction to OOP (Java)


Published on

Introduction to OOP (Java)

  • Be the first to comment

Chapter1 Introduction to OOP (Java)

  1. 1. Chapter 1 Basic OOP Concept
  2. 2. Basic Concept Object Class Inheritence Polimorphism Encapsulation Data Abstraction Dyah Fajar Nur Rohmah
  3. 3. Class In OO model, some of the objects exhibits identical characteristics (information structure and behavior) Structure that contains common data and function as entity for object Dyah Fajar Nur Rohmah
  4. 4. Object Instance of classes A person, place or concept Has attributes, state and behavior Interact sending message to each other Dyah Fajar Nur Rohmah
  5. 5. Example - Class Dimas studies mathematics Femy studies software engineering Ganang studies computer science Each one is a Student These are called object of the Student class Dyah Fajar Nur Rohmah
  6. 6. Struktur Class class car { Nama class int fuel; int maxSpeed;      public car() { MaxSpeed=0; } refuel() { }     SetSpeed(){     } } Dyah Fajar Nur Rohmah method attributes constructor
  7. 7. Declaration of an object class Rectangle {       int width;       int height;    public void set      (int w, int l){    } } main() {    Rectangle rect1;    Rectangle rect2;    rect1.set(4,9);    rect2.set(5,8); } Rect1 → width = 4 and length = 9 Rect2 → width = 5 and length = 8 Dyah Fajar Nur Rohmah
  8. 8. Let's write some codes... Dyah Fajar Nur Rohmah