Progettazione SW - 12 introduzione a java come linguaggio oop. lezione 2
2. java oop
-
Upload
vitalify-asia -
Category
Documents
-
view
2.113 -
download
5
description
Transcript of 2. java oop
![Page 2: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/2.jpg)
Nội dung� Program Structure
� Comments
� Data Types
� Constants
� Enumerations
� Exception Handling
� Package
� Classes / Interfaces
� Constructors / Destructors
� Objects � Enumerations
� Operators
� Choices
� Loops
� Arrays
� Methods
� Strings
� Objects
� Properties
� Structs
� Console I/O
� File I/O
� Generics
2
![Page 3: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/3.jpg)
Program StructureProgram Structure
JAVA C#
3
![Page 4: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/4.jpg)
Program StructureProgram Structure
JAVA C#
4
![Page 5: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/5.jpg)
CommentComment
JAVA C#
5
![Page 6: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/6.jpg)
Data TypeData Type
JAVA C#
6
![Page 7: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/7.jpg)
Data TypeData Type
JAVA C#
7
![Page 8: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/8.jpg)
ConstantsConstants
JAVA C#
8
![Page 9: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/9.jpg)
EnumerationEnumeration
JAVA C#
9
![Page 10: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/10.jpg)
OperatorOperator
JAVA C#
10
![Page 11: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/11.jpg)
Operator overloadingOperator overloading
JAVA C#
Không hỗ trợ
11
Không hỗ trợ
![Page 12: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/12.jpg)
Operator overloadingOperator overloading
JAVA C#
Không hỗ trợ
12
Không hỗ trợ
![Page 13: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/13.jpg)
Operator overloadingOperator overloading
JAVA C#
Không hỗ trợ
13
Không hỗ trợ
![Page 14: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/14.jpg)
ChoicesChoices
JAVA C#
14
![Page 15: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/15.jpg)
LoopLoop
JAVA C#
15
![Page 16: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/16.jpg)
ArrayArray
JAVA C#
16
![Page 17: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/17.jpg)
MethodMethod
JAVA C#
17
![Page 18: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/18.jpg)
MethodMethod
JAVA C#
18
![Page 19: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/19.jpg)
MethodMethod
JAVA C#
19
![Page 20: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/20.jpg)
StringString
JAVA C#
20
![Page 21: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/21.jpg)
ExceptionException
JAVA C#
21
![Page 22: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/22.jpg)
PackagePackage
JAVA C#
22
![Page 23: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/23.jpg)
ScopeScope
JAVA C#
23
![Page 24: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/24.jpg)
Class / InterfaceClass / Interface
JAVA C#
24
![Page 25: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/25.jpg)
Constructors / DestructorsConstructors / Destructors
JAVA C#
25
![Page 26: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/26.jpg)
ObjectObject
JAVA C#
26
![Page 27: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/27.jpg)
PropertiesProperties
JAVA C#
27
![Page 28: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/28.jpg)
StructsStructs
JAVA C#
28
![Page 29: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/29.jpg)
Console I/OConsole I/O
JAVA C#
29
![Page 30: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/30.jpg)
File I/OFile I/O
JAVA C#
30
![Page 31: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/31.jpg)
File I/OFile I/O
JAVA C#
31
![Page 32: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/32.jpg)
None GenericsNone Generics
32
?
![Page 33: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/33.jpg)
None GenericsNone Generics
?
33
?
![Page 34: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/34.jpg)
None GenericsNone Generics
Compile Time:BUILD SUCCESSFUL
34
Runtime: Error
![Page 35: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/35.jpg)
GenericsGenerics
35
![Page 36: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/36.jpg)
GenericsGenerics
36
![Page 37: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/37.jpg)
GenericsGenerics
Compile Time: BUILD FAILED
37
Runtime: SAFE
![Page 38: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/38.jpg)
Generics Generics –– Collection InterfacesCollection Interfaces
CollectionCollectionCollectionCollection
SetSetSetSet ListListListList QueueQueueQueueQueue
38
SortedSetSortedSetSortedSetSortedSet
![Page 39: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/39.jpg)
Generics Generics –– ArrayListArrayList, , LinkedListLinkedList
ListListListList
39
ArrayListArrayListArrayListArrayList LinkedListLinkedListLinkedListLinkedList
![Page 40: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/40.jpg)
HỎI VÀ ĐÁP
40
![Page 41: 2. java oop](https://reader036.fdocument.pub/reader036/viewer/2022081505/5563a3cdd8b42a2d538b5460/html5/thumbnails/41.jpg)
ThamTham khảokhảo
� Frank McCown :Java (J2SE 5.0) and C# Comparison
� The Java Language Specification Third Edition
41