Instance-of Relationship Employee Before you can create instances of a class the class must be defined The dotted line shows he instance-of relationship Bill Steve And The class name can be omitted since it is clear Employee Employee Employee which class these objects belong to C 2000 McGraw-Hill troduction to Object-Oriented Programming with Java--Wu Chapter 1-6
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 1 - 6 Instance-of Relationship Employee Employee Bill Employee Steve Employee Andy The class name can be omitted since it is clear which class these objects belong to . The dotted line shows the instance-of relationship. Before you can create instances of a class, the class must be defined
Messages and methods r To instruct a class or an object to perform a task, we send a message to it You can send a message only to the classes and objects the at understand the message you sent to them r a class or an object must possess a matching method to be able to handle the received message ra method defined for a class is called a class method and a method defined for an object is called an instance method r A value we pass to an object when sending a message is called an argument of the message C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 1-7
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 1 - 7 Messages and Methods To instruct a class or an object to perform a task, we send a message to it. You can send a message only to the classes and objects that understand the message you sent to them. A class or an object must possess a matching method to be able to handle the received message. A method defined for a class is called a class method, and a method defined for an object is called an instance method. A value we pass to an object when sending a message is called an argument of the message
Sending a message Message deposit with the argument 250.00 is sent to chk-008 chk-008 Account deposit 250.00 -deposit Message name is usually omitted in the diagram 250.00 D deposit C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 1-8
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 1 - 8 Sending a Message Message deposit with the argument 250.00 is sent to chk-008. Account chk-008 deposit deposit 250.00 Message name is usually omitted in the diagram. deposit 250.00