10. Objects and Classes Bank Account A class (the concept) John’s Bank Account Balance: $5,257 An object (the realization) Bill’s Bank Account Balance: $1,245,069 Mary’s Bank Account Balance: $16,833 Multiple objects from the same class
22. Class Car Car color speed power drive turn right turn left stop attributes operations class name
23. in Java Car String color int speed int power drive() turnRight() turnLeft() stop() attributes or instance variables methods class name
24.
25. Class Pencil Pencil int location String direction home() up() down() write() attributes methods Name
26.
27.
28.
29.
30. Declaring Objects Class Person ayse; Person String name String birthDate int age getName() getAge … . ayse is of Class
31.
32. Declaring and Creating Objects Class karanfil = new Flower(); Flower karanfil; Flower int age int length int weight getAge() getLength() … . Object instance of refers to karanfil is of Class
33.
34.
35. Example ayse Class Object instance of refers to is of Class ayse = new Person(); Person ayse; ayse.setName( “Ayse Engin“) ; ayse.setAge(24); Person String name String birthDate int age setName(String name) setAge(int age) getName() … . Ayse Engin 24