Lecture Notes for JAVA
Krmoll’s
email: {andrey,molli}@loria.fr
web: http://www.loria.fr/˜molli,andrey
ESIAL, UniversiedeNancyI,
IUT de Dijon, Universit´e de Bourgogne
August 26, 1998
JAVA IN
HANOI
1
Pascal Molli (molli@loria.fr) 2 ESIAL Nancy
CONTENTS CONTENTS
Contents
1 Introduction 6
2 The Java Programming Language 19
2.1 Overview ...................................... 19
2.2 CompilationandExecution ............................ 21
2.3 ClassesandObjects ................................ 27
2.3.1 ClassesandObjects ............................ 27
2.3.2 InstantiationandConstructors ...................... 32
2.3.3 ClassesandEncapsulation......................... 34
2.3.4 Arrays.................................... 36
2.3.5 GarbageCollectorsvsDestructors .................... 38
2.3.6 ClassFields,ClassMethods........................ 45
2.4 Inheritance ..................................... 51
2.4.1 OverviewandSimpleExample ...................... 52
2.4.2 InheritanceandConstructors ....................... 54
2.4.3 Hiding,Overriding,Overloading... .................... 59
2.5 Polymorphism.................................... 64
2.5.1 Overview .................................. 64
2.5.2 Polymorphism,inheritanceandabstractclasses............. 65
2.5.3 AbstractandFinalClasses ........................ 68
2.5.4 PolymorphismandInterfaces ....................... 73
2.5.5 InterfacesvsMultipleInheritance..................... 76
2.6 InheritanceandEncapsulation .......................... 80
2.6.1 InheritanceandPrivate .......................... 80
2.6.2 EncapsulationandOverriding....................... 81
2.6.3 ProtectedModier............................. 84
2.7 Exceptions ..................................... 86
2.7.1 AnatomyandLifeCycle.......................... 86
2.7.2 Throwing .................................. 88
2.7.3 Propagation . . . . ............................. 89
2.7.4 Catching .................................. 90
2.7.5 Execution.................................. 92
2.7.6 ObfuscatedExamples ........................... 92
2.8 Conversions..................................... 97
2.8.1 Primitivestypesandconversion/promotions............... 97
2.8.2 ExplicitConversionsandWrappers....................101
2.8.3 ImplicitConversionandOverloading...................102
2.8.4 Conversionofreferencesandinheritance.................103
2.8.5 GenericclassesandConversions .....................105
2.9 Packages.......................................107
2.9.1 PackageandNaming............................108
2.9.2 Publicclasses,Packageclasses ......................111
2.9.3 Public,Private,ProtectedandPackage .................116
2.9.4 Package,EncapsulationandInheritance .................118
3 Threads 122
3.1 Overview ......................................122
3.2 Example.......................................123
3.3 ThreadsAttributes.................................125
3.3.1 TheStatesoftheThreads.........................125
3.3.2 Priorities ..................................126
3.3.3 Threaddaemons ..............................135
3.3.4 GroupsofThreads.............................136
3.4 Multi-ThreadedPrograms.............................138
Laurent Andrey (andrey@loria.fr) 3 IUT de Dijon
CONTENTS CONTENTS
3.4.1 Synchronization ..............................138
3.4.2 CIS 307: Implementing Hoare’s Monitors . . . .............141
3.4.3 Deadlock,famines...............................149
4 Advanced Window Toolkit 151
4.1 GeneralArchitecture................................152
4.2 GraphicalComponents...............................155
4.2.1 BasicComponents .............................161
4.2.2 CompoundtheComponents........................163
4.2.3 ManagingMenus..............................175
4.3 EventsManagement ................................179
4.3.1 EventsManagementin1.0.........................180
4.3.2 TheMethodbyDelegation(1.1) .....................192
4.4 2DGraphics.....................................203
4.5 Conclusion .....................................215
5 Applet 217
5.1 AppletetAWT...................................219
5.2 Lifecycleofanappletwithinabrowser .....................219
5.3 AppletsandHTML ................................222
5.4 AppletsandCommunications...........................224
5.4.1 Conclusions.................................226
5.5 Codedistributionanddigitalsignature......................228
5.5.1 Appletandsecurity ............................228
5.5.2 DigitalSignatureandpublickeys.....................229
5.5.3 Largescaledeploymentofpublickeys:certication...........233
5.5.4 jdk1.1implementation ..........................238
5.5.5 The jar le:JavaARchives........................240
5.5.6 BriefBibliography .............................244
6 Conclusion 246
6.1 TwowordsonJDBC................................246
6.2 TwowordsonRMI.................................247
6.3 ThreewordsonJavaBeans.............................248
6.4 OverallConclusion .................................251
Pascal Molli (molli@loria.fr) 4 ESIAL Nancy
CONTENTS CONTENTS
First steps in Java
Krmoll’s
email: {andrey,molli}@loria.fr
web: http://www.loria.fr/˜ {molli,andrey}
August 26, 1998
Duke is saying ...
... Hello
Slide 1
Contents
Introduction
Language: classes, inheritance, polymorphism, Packages...
Threads
Advanced Window Toolkit (AWT)
Applets
Perspective-Conclusions
Slide 2
Laurent Andrey (andrey@loria.fr) 5 IUT de Dijon
1 / 254 100%
La catégorie de ce document est-elle correcte?
Merci pour votre participation!

Faire une suggestion

Avez-vous trouvé des erreurs dans linterface ou les textes ? Ou savez-vous comment améliorer linterface utilisateur de StudyLib ? Nhésitez pas à envoyer vos suggestions. Cest très important pour nous !