Object Oriented Programming u
p p p
sing Java
p
, Contents
Foreword 11
1 Anp Introductionp top Objectp Orientatedp Programming 12
1.1 ApBriefpHistorypofpComputing 12
1.2 DifferentpProgrammingpParadigms 13
1.3 WhypusepthepObjectpOrientationpParadigm? 15
1.4 Objectp Orientedp Principles 16
1.5 WhatpExactlypispObjectpOrientedpProgramming? 20
1.6 ThepBenefitspofpthepObjectpOrientedpProgrammingpApproach 23
1.7 Summary 23
2 Thep Unifiedp Modellingp Languagep (UML) 24
2.1 AnpIntroductionptopUML 24
2.2 UMLpClassp diagrams 25
2.3 UMLp Syntax 29
2.4 UMLpPackagepDiagrams 41
www.sylvania.com
We do not reinvent the
p p p p p
wheel we reinvent light.
p p p
Fascinatingplightingpofferspanpinfinitepspectrumpofppo
ssibilities:pInnovativeptechnologiespandpnewpmarketsp
providepbothpopportunitiespandpchallenges.pAnpenvir
onmentpinpwhichpyourpexpertisepispinphighpdemand.p
Enjoypthepsupportivepworkingpatmospherepwithinpourp
globalpgrouppandpbenefitpfrompinternationalpcareerppath
s.pImplementpsustainablepideaspinpclosepcooperation
pwithpotherpspecialistspandpcontributeptopinfluencingpo
urpfuture.pComepandpjoinpuspinpreinventingplightpeveryp
day.
Lightp isp OSRAM
,2.5 UMLp Objectp Diagrams 47
2.6 UMLp Sequencep Diagrams 48
2.7 Summary 50
3 Inheritancep andp Methodp Overriding 51
3.1 ObjectpFamilies 52
3.2 GeneralisationpandpSpecialisation 52
3.3 Inheritance 54
3.4 ImplementingpInheritancepinpJava 61
3.5 Constructors 61
3.6 ConstructorpRules 62
3.7 AccesspControl 64
3.8 AbstractpClasses 65
3.9 Overridingp Methods 66
3.10 Thep‘Object’pClass 68
3.11 OverridingptoString()pdefinedpinp‘Object’ 70
3.12 Summary 71
360°
thinking .
Discoverptheptruthp atpwww.deloitte.ca/careers ©pDeloittep&pTouchepLLPpandpaffiliatedpentiti
es.
, 4 ObjectpRolespandpthepImportancepofpPolymorphism 72
4.1 ClasspTypes 72
4.2 Substitutability 75
4.3 Polymorphism 76
4.4 Extensibility 77
4.5 Interfaces 84
4.6 Extensibilityp Again 90
4.7 DistinguishingpSubclasses 93
4.8 Summary 94
5 Overloading 95
5.1 Overloading 96
5.2 Overloadingp TopAidp Flexibility 96
5.3 Summary 99
6 ObjectpOrientedpSoftwarepAnalysispandpDesign 100
6.1 Requirementsp Analysis 101
6.2 ThepProblem 102
6.3 ListingpNounspandpVerbs 104
6.4 IdentifyingpThingspOutsidepThepScopepofpThepSystem 105
We will turn your CV into an
p p p p p p p
opportunity of a lifetime
p p p
Dopyouplikepcars?pWouldpyouplikeptopbepappartpofpapsuccessfulpbrand?p SendpuspyourpCVpon
Wepwillpappreciatepandprewardpbothpyourpenthusiasmpandptalent.pS www.employerforlife.com
endpuspyourpCV.pYoupwillpbepsurprisedpwherepitpcanptakepyou.
p p p
sing Java
p
, Contents
Foreword 11
1 Anp Introductionp top Objectp Orientatedp Programming 12
1.1 ApBriefpHistorypofpComputing 12
1.2 DifferentpProgrammingpParadigms 13
1.3 WhypusepthepObjectpOrientationpParadigm? 15
1.4 Objectp Orientedp Principles 16
1.5 WhatpExactlypispObjectpOrientedpProgramming? 20
1.6 ThepBenefitspofpthepObjectpOrientedpProgrammingpApproach 23
1.7 Summary 23
2 Thep Unifiedp Modellingp Languagep (UML) 24
2.1 AnpIntroductionptopUML 24
2.2 UMLpClassp diagrams 25
2.3 UMLp Syntax 29
2.4 UMLpPackagepDiagrams 41
www.sylvania.com
We do not reinvent the
p p p p p
wheel we reinvent light.
p p p
Fascinatingplightingpofferspanpinfinitepspectrumpofppo
ssibilities:pInnovativeptechnologiespandpnewpmarketsp
providepbothpopportunitiespandpchallenges.pAnpenvir
onmentpinpwhichpyourpexpertisepispinphighpdemand.p
Enjoypthepsupportivepworkingpatmospherepwithinpourp
globalpgrouppandpbenefitpfrompinternationalpcareerppath
s.pImplementpsustainablepideaspinpclosepcooperation
pwithpotherpspecialistspandpcontributeptopinfluencingpo
urpfuture.pComepandpjoinpuspinpreinventingplightpeveryp
day.
Lightp isp OSRAM
,2.5 UMLp Objectp Diagrams 47
2.6 UMLp Sequencep Diagrams 48
2.7 Summary 50
3 Inheritancep andp Methodp Overriding 51
3.1 ObjectpFamilies 52
3.2 GeneralisationpandpSpecialisation 52
3.3 Inheritance 54
3.4 ImplementingpInheritancepinpJava 61
3.5 Constructors 61
3.6 ConstructorpRules 62
3.7 AccesspControl 64
3.8 AbstractpClasses 65
3.9 Overridingp Methods 66
3.10 Thep‘Object’pClass 68
3.11 OverridingptoString()pdefinedpinp‘Object’ 70
3.12 Summary 71
360°
thinking .
Discoverptheptruthp atpwww.deloitte.ca/careers ©pDeloittep&pTouchepLLPpandpaffiliatedpentiti
es.
, 4 ObjectpRolespandpthepImportancepofpPolymorphism 72
4.1 ClasspTypes 72
4.2 Substitutability 75
4.3 Polymorphism 76
4.4 Extensibility 77
4.5 Interfaces 84
4.6 Extensibilityp Again 90
4.7 DistinguishingpSubclasses 93
4.8 Summary 94
5 Overloading 95
5.1 Overloading 96
5.2 Overloadingp TopAidp Flexibility 96
5.3 Summary 99
6 ObjectpOrientedpSoftwarepAnalysispandpDesign 100
6.1 Requirementsp Analysis 101
6.2 ThepProblem 102
6.3 ListingpNounspandpVerbs 104
6.4 IdentifyingpThingspOutsidepThepScopepofpThepSystem 105
We will turn your CV into an
p p p p p p p
opportunity of a lifetime
p p p
Dopyouplikepcars?pWouldpyouplikeptopbepappartpofpapsuccessfulpbrand?p SendpuspyourpCVpon
Wepwillpappreciatepandprewardpbothpyourpenthusiasmpandptalent.pS www.employerforlife.com
endpuspyourpCV.pYoupwillpbepsurprisedpwherepitpcanptakepyou.