当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

《JAVA OOP开发》英文版 Chapter 1 Introduction to Object-oriented Programming and Software Development

资源类别:文库,文档格式:PPT,文档页数:22,文件大小:214.5KB,团购合买
Chapter 1 Objectives After you have read and studied this chapter, you should be able to Name the basic components of object-oriented programming. Differentiate classes and objects. Differentiate class and instance methods. Differentiate class and instance data values.
点击下载完整版文档(PPT)

Chapter 1 Introduction to Object-oriented Programming and Software Development Introduction to Object-Oriented Programming 2000 McGraw-Hl‖ Java--Wu Chapter 1-1

© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 1 - 1 Chapter 1 Introduction to Object-oriented Programming and Software Development

Chapter 1 objectives After you have read and studied this chapter, you should be able to e Name the basic components of object-oriented programming e Differentiate classes and objects e Differentiate class and instance methods e Differentiate class and instance data values e Draw object diagrams using icons for classes objects and other components of object-oriented programming e Describe the significance of inheritance in object-oriented programs. Name and explain the stages of the software life cycle C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 1-2

© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 1 - 2 Chapter 1 Objectives After you have read and studied this chapter, you should be able to Name the basic components of object-oriented programming. Differentiate classes and objects. Differentiate class and instance methods. Differentiate class and instance data values. Draw object diagrams using icons for classes, objects, and other components of object-oriented programming. Describe the significance of inheritance in object-oriented programs. Name and explain the stages of the software life cycle

Classes and objects r Object-oriented programs use objects r An object is a thing both tangible and intangible Account, Vehicle, Employee, eto r To create an object inside the computer program, we must provide a definition for objects--how they behave and what kinds of information they maintain -called a class. r An object is called an instance of a class C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 1-3

© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 1 - 3 Classes and Objects Object-oriented programs use objects. An object is a thing, both tangible and intangible. Account, Vehicle, Employee, etc. To create an object inside the computer program, we must provide a definition for objects—how they behave and what kinds of information they maintain —called a class. An object is called an instance of a class

Graphical Representation of an object The objects name appears on top of the sV129 Icon Account An icon for an object is The class name is the rounded rectangle placed inside the object icon customer1 The class name may be omitted when it is clear from the context which class the object belongs to C 2000 McGraw-Hill troduction to Object-Oriented Programming with Java--Wu Chapter 1-4

© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 1 - 4 Graphical Representation of an Object Account SV129 The class name is placed inside the object icon. The object’s name appears on top of the icon. An icon for an object is the rounded rectangle. The class name may be omitted when it is clear from the context which class the object belongs to. customer1

Graphical Representation of a Class The class name appears on top of the Account Icon An icon for a class is the tangle C 2000 McGraw-Hill troduction to Object-Oriented Programming with Java--Wu Chapter 1-5

© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 1 - 5 Graphical Representation of a Class Account The class name appears on top of the icon. An icon for a class is the rectangle

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

Sending a Message and getting an Answer This message has no argument chk-008 Account getMonthlyFee monthly fee The method returns the value monthly fee back to the message sender C 2000 McGraw-Hill troduction to Object-Oriented Programming with Java--Wu Chapter 1-9

© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 1 - 9 Sending a Message and Getting an Answer This message has no argument. Account chk-008 getMonthlyFee monthly fee The method returns the value monthly fee back to the message sender

Calling a class method Account → >IgetAverageBalance average balance The average balance of all accounts is returned C 2000 McGraw-Hill troduction to Object-Oriented Programming with Java--Wu Chapter 1-10

© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 1 - 10 Calling a Class Method Account getAverageBalance average balance The average balance of all accounts is returned

点击下载完整版文档(PPT)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
共22页,试读已结束,阅读完整版请下载
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有