Chapter 1 Introduction to Object-oriented programming and software Development课件.ppt


文档分类:IT计算机 | 页数:约22页 举报非法文档有奖
1/22
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/22
文档列表 文档介绍
该【Chapter 1 Introduction to Object-oriented programming and software Development课件 】是由【yzhluyin9】上传分享,文档一共【22】页,该文档可以免费在线阅读,需要了解更多关于【Chapter 1 Introduction to Object-oriented programming and software Development课件 】的内容,可以使用淘豆网的站内搜索功能,选择自己适合的文档,以下文字是截取该文章内的部分文字,如需要获得完整电子版,请下载此文档到您的设备,方便您编辑和打印。Chapter1
IntroductiontoObject-orientedProgramming
and
SoftwareDevelopment
©2000McGraw-Hill
Chapter1-1
IntroductiontoObject-OrientedProgrammingwithJava--Wu
Chapter1Objectives
Afteryouhavereadandstudiedthischapter,youshouldbeableto
Namethebasiccomponentsofobject-orientedprogramming.
Differentiateclassesandobjects.
Differentiateclassandinstancemethods.
Differentiateclassandinstancedatavalues.
Drawobjectdiagramsusingiconsforclasses,objects,andothercomponentsofobject-orientedprogramming.
Describethesignificanceofinheritanceinobject-orientedprograms.
Nameandexplainthestagesofthesoftwarelifecycle.
©2000McGraw-Hill
2
IntroductiontoObject-OrientedProgrammingwithJava--Wu
ClassesandObjects
Object-orientedprogramsuseobjects.
Anobjectisathing,,Vehicle,Employee,etc.
Tocreateanobjectinsidethecomputerprogram,wemustprovideadefinitionforobjects—howtheybehaveandwhatkindsofinformationtheymaintain—calledaclass.
Anobjectiscalledaninstanceofaclass.
©2000McGraw-Hill
3
IntroductiontoObject-OrientedProgrammingwithJava--Wu
GraphicalRepresentationofaClass
Account
Theclassnameappearsontopoftheicon.
Aniconforaclassistherectangle.
©2000McGraw-Hill
5
IntroductiontoObject-OrientedProgrammingwithJava--Wu
Instance-ofRelationship
Employee
Employee
Bill
Employee
Steve
Employee
Andy
Theclassnamecanbeomittedsinceitisclearwhichclasstheseobjectsbelongto.
Thedottedlineshowstheinstance-ofrelationship.
Beforeyoucancreateinstancesofaclass,theclassmustbedefined.
©2000McGraw-Hill
6
IntroductiontoObject-OrientedProgrammingwithJava--Wu
MessagesandMethods
Toinstructaclassoranobjecttoperformatask,wesendamessagetoit.
Youcansendamessageonlytotheclassesandobjectsthatunderstandthemessageyousenttothem.
Aclassoranobjectmustpossessamatchingmethodtobeabletohandlethereceivedmessage.
Amethoddefinedforaclassiscalledaclassmethod,andamethoddefinedforanobjectiscalledaninstancemethod.
Avaluewepasstoanobjectwhensendingamessageiscalledanargumentofthemessage.
©2000McGraw-Hill
7
IntroductiontoObject-OrientedProgrammingwithJava--Wu
SendingaMessageandGettinganAnswer
Thismessagehasnoargument.
Account
chk-008
getMonthlyFee
monthlyfee
Themethodreturnsthevaluemonthlyfeebacktothemessagesender.
©2000McGraw-Hill
9
IntroductiontoObject-OrientedProgrammingwithJava--Wu
CallingaClassMethod
Account
getAverageBalance
averagebalance
Theaveragebalanceofallaccountsisreturned.
©2000McGraw-Hill
10
IntroductiontoObject-OrientedProgrammingwithJava--Wu
SummaryofClassandObjectIcons
<result>
<ClassName>
Squaredcornersareusedforaclassandclassmethods.
Aninstancemethodiconisdrawninadottedline.
<ClassName>
<ObjectName>
<result>
Roundedcornersareusedforaclassandclassmethods.
©2000McGraw-Hill
11
IntroductiontoObject-OrientedProgrammingwithJava--Wu
SampleInstanceDataValue
Account
SV129
Account
SV506
Account
SV008
currentbalance
currentbalance
currentbalance
AllthreeAccountobjectspossessthesameinstancedatavaluecurrentbalance.
Theactualdollaramountsare,ofcourse,different.



©2000McGraw-Hill
13
IntroductiontoObject-OrientedProgrammingwithJava--Wu

Chapter 1 Introduction to Object-oriented programming and software Development课件 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数22
  • 收藏数0 收藏
  • 顶次数0
  • 上传人yzhluyin9
  • 文件大小1.21 MB
  • 时间2022-12-01