Object-Oriented Programming 2
description
Transcript of Object-Oriented Programming 2
![Page 1: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/1.jpg)
CCHAPTERHAPTER 22
BBASICASIC PPROGRAMMINGROGRAMMINGBBASICASIC PPROGRAMMINGROGRAMMING
CCONCEPTSONCEPTS
Mr.Warawut Khangkhan
e-Mail: [email protected]
Social Media: www.facebook.com/AjWarawut
![Page 2: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/2.jpg)
STRUCTURED
PROGRAMMING IN
Mr.W
ara
wut K
hangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
PROGRAMMING IN
JAVA
Basic P
rogra
mming C
oncepts
2
![Page 3: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/3.jpg)
Mr.W
ara
wut
Khangkhan
Chapter 1
Java &
OOP
Java &
OOP
3
![Page 4: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/4.jpg)
DATA &
Mr.W
ara
wut K
hangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
DATA &
VARIABLE
Chapter 2
Basic P
rogra
mming C
oncepts
4
![Page 5: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/5.jpg)
������������� ���������������������� ��������� JJAVAAVA
��������������� � a-z, A-Z, _, $ �������
������������������� a-z, A-Z, _, $
����� ������������������� !� "#������$�%�������
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
���� ������������������� !� "#������$�%�������(Case Sensitive)
� �����&'#(�)�*���%*�+&�� (Reserved Word) ���
Literal Words (True, False, Null)
5
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 6: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/6.jpg)
�� ������� ����� RRESERVEDESERVED WWORDORD
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
6
Basic P
rogra
mming C
oncepts
![Page 7: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/7.jpg)
����������� �������������� ���
(D(DECLARATIONECLARATION))
���$����+���&����� ,��*� ��'#(����'�������-� (Data
Type) � ��������
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
dataType varName [= value];
7
Chapter 2
Basic P
rogra
mming C
oncepts
dataType varName [= value];
dataType = �������������� ���
varName = ���� ���
value = �������� ���
![Page 8: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/8.jpg)
�� ����� ����������� ����� ����� ����������� ���Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
String name;float score;char grade;
8
Basic P
rogra
mming C
oncepts
String name = “Warawut”;float score = 85.5f;char grade = ‘A’;
![Page 9: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/9.jpg)
Mr.W
ara
wut K
hangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
DATA TYPE
Basic P
rogra
mming C
oncepts
9
![Page 10: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/10.jpg)
������������������������ (D(DATAATA TTYPEYPE))
�Primitive Data Type - ����-��#��.����&�� �
�Class Type – ����-��/("�������0��%��+ �#�Interface
Array Type – ����-��/(��$�������� �#�����-���$�'1�2
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
�Array Type – ����-��/(��$�������� �#�����-���$�'1�2
10
Basic P
rogra
mming C
oncepts
![Page 11: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/11.jpg)
���������� �������������� ����(P(PRIMITIVERIMITIVE DDATAATA TTYPEYPE))
�����-�'���0*�������� (Integer)
�����-�'����3��� (Floating Point)
�����-�'���������� (Character)
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
����-�'����������
�����-�'���%��%���0��& (Boolean)
11
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 12: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/12.jpg)
INTEGER TYPEDataDataDataData TypeTypeTypeType Size Size Size Size
(Byte)(Byte)(Byte)(Byte)RangeRangeRangeRange
byte 1 -128 to +127
short 2 -32,768 to +32,767
int 4 -2,147,483,648 to
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
int 4 -2,147,483,648 to
+2,147,483,647
long 8 -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807
12
Basic P
rogra
mming C
oncepts
![Page 13: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/13.jpg)
EX. INTEGER TYPE Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
byte A = 65;short B = 32767;int C = 2147286444;long D = 21472864448L;
13
Chapter 2
Basic P
rogra
mming C
oncepts
long D = 21472864448L;long E = 21472864438l;
![Page 14: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/14.jpg)
FLOATING POINT TYPEDataDataDataData TypeTypeTypeType Size Size Size Size
(Byte)(Byte)(Byte)(Byte)RangeRangeRangeRange
float 4 -3.40292347E+38 to +3.40292347E+38
double 8 -1.79769313486231570E+308
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
double 8 -1.79769313486231570E+308 to +1.79769313486231570E+308
14
Basic P
rogra
mming C
oncepts
float a = 200;float b = 200.5f; // 200.5F;double c = 300;double d = 300.7d; // 300.7D;
![Page 15: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/15.jpg)
CHARACTER TYPEDataDataDataData TypeTypeTypeType Size Size Size Size
(Byte)(Byte)(Byte)(Byte)RangeRangeRangeRange
char 2 0 to 65,535
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
char c = ‘A’;
15
Chapter 2
Basic P
rogra
mming C
oncepts
char c = ‘A’;char cInt = 65;
![Page 16: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/16.jpg)
EX. PROGRAMMING
CHARACTER TYPE Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
16
Basic P
rogra
mming C
oncepts
![Page 17: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/17.jpg)
BOOLEAN TYPE
�%��%���0��&��&����3�+���
���/�4�� 2 %�� ������� %#� true ��� false ��$������������
��& ��
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
17
Chapter 2
Basic P
rogra
mming C
oncepts
boolean b1 = false;boolean b2 = true;
![Page 18: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/18.jpg)
STRING TYPE
��� � Java 4���/����*� ��'�������-�'����/�
��'������'�������-����-����%��+ (class)
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
String name = “Warawut”;
18
Basic P
rogra
mming C
oncepts
String name = “Warawut”;String langProg = “Java”;
![Page 19: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/19.jpg)
Mr.W
ara
wut K
hangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
CONSTANT
Basic P
rogra
mming C
oncepts
19
![Page 20: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/20.jpg)
�����!"������!"� (C(CONSTANTONSTANT))
�%#� %������-�'�����'��� ��(&�/(4���/������/(����&���5��/(
,�������*�&��
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
final dataType varName [= value];
20
Basic P
rogra
mming C
oncepts
final dataType varName [= value];
dataType = �������������� ���
varName = ���� ���
value = �������� ���
![Page 21: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/21.jpg)
EX. PROGRAMMING
CONSTANT Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
21
Basic P
rogra
mming C
oncepts
![Page 22: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/22.jpg)
EX. PROGRAMMING
CONSTANT Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
22
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 23: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/23.jpg)
Mr.W
ara
wut K
hangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
OPERATOR
Basic P
rogra
mming C
oncepts
23
![Page 24: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/24.jpg)
�� �#�$�������� �#�$������ (O(OPERATORPERATOR))
���%&�' (Expression) ��"�& ���%��� �#����,%�/(
��/��-����-�+!�� 5� ,��*�����-�, �����, 78&��'� �#�
%��%&�/( ��+���9������*�������� (Operator) ���&��
���& ��(&
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
���& ��(&
24
Basic P
rogra
mming C
oncepts
num1 + num2
a = (b - c) * d
![Page 25: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/25.jpg)
�� �#�$�������� �#�$������ (O(OPERATORPERATOR))
����*���������*� ��%�� (Assignment
Operators)
����*����������&%5��3�+��� (Arithmetic
Operators)
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
Operators)
����*�����������/���/� (Comparison
Operators)
����*����������&����3�+��� (Logical Operators)
����*��������-���/ (Unary Operators)
����*��������������� (Bitwise Operators) 25
Basic P
rogra
mming C
oncepts
![Page 26: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/26.jpg)
AASSIGNMENTSSIGNMENT
OOPERATORSPERATORS
OperatorOperatorOperatorOperator DescriptionDescriptionDescriptionDescription
= ������
+= ���������
-=
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
-= ��������
*= %-5������
/= ��������
%= ������3 ������
26
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 27: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/27.jpg)
AASSIGNMENTSSIGNMENT
OOPERATORSPERATORS Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
��%&�' ����!������%&�' ��������%&�'
a = 30 a = 30 30
a += 5 a = a + 5 35
a -= 10 a = a - 10 25
27
Basic P
rogra
mming C
oncepts
a -= 10 a = a - 10 25
a *= 2 a = a * 2 50
a /= 5 a = a / 5 10
a %= 5 a = a % 5 0
![Page 28: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/28.jpg)
AARITHMETICRITHMETIC OOPERATORSPERATORS
OperatorOperatorOperatorOperator DescriptionDescriptionDescriptionDescription ExampleExampleExampleExample
+ ��� a + b
- �� a - b
* a * b
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
* %-5 a * b
/ �� a / b
% ��3 0����� �� a % b
28
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 29: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/29.jpg)
CCOMPARISONOMPARISON
OOPERATORSPERATORS
OperatorOperatorOperatorOperator DescriptionDescriptionDescriptionDescription ExampleExampleExampleExample
== ������ a == b
!= 4�������� a != b
> a > b
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
> ������� a > b
>= ������� �#������� a >= b
< ������� a < b
<= ������� �#������� a <= b
29
Basic P
rogra
mming C
oncepts
![Page 30: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/30.jpg)
LLOGICALOGICAL OOPERATORSPERATORS
OperatorOperatorOperatorOperator DescriptionDescriptionDescriptionDescription ExampleExampleExampleExample
&& and a && b
|| or a || b
! not !a
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
! not !a
30
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 31: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/31.jpg)
LLOGICALOGICAL OOPERATORSPERATORS
aaaa bbbb a &&a &&a &&a && bbbb a ||a ||a ||a || bbbb !a!a!a!a !b!b!b!b
T T T T F F
T F F T F T
F T F T T F
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
F T F T T F
F F F F T T
31
Chapter 2
Basic P
rogra
mming C
onceptsT – True
F – False
![Page 32: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/32.jpg)
UUNARYNARY OOPERATORSPERATORS
OperatorOperatorOperatorOperator DescriptionDescriptionDescriptionDescription FormatFormatFormatFormat ExampleExampleExampleExample ExecuteExecuteExecuteExecute
++ ���(�%���/�� ��(& Postfix a = b++ a = bb = b + 1
Prefix a = ++ b b = b + 1a = b
-- ��%���/�� ��(& Postfix a = b-- a = b
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
-- ��%���/�� ��(& Postfix a = b-- a = bb = b - 1
Prefix a = --b b = b – 1a = b
32
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 33: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/33.jpg)
UUNARYNARY OOPERATORSPERATORS Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
a = 5;a = 5;a = 5;a = 5;
System.out.printlnSystem.out.printlnSystem.out.printlnSystem.out.println(a);(a);(a);(a);System.out.printlnSystem.out.printlnSystem.out.printlnSystem.out.println(a++);(a++);(a++);(a++);System.out.printlnSystem.out.printlnSystem.out.printlnSystem.out.println(++a);(++a);(++a);(++a);
555555557777
33
Chapter 2
Basic P
rogra
mming C
oncepts
System.out.printlnSystem.out.printlnSystem.out.printlnSystem.out.println(++a);(++a);(++a);(++a);System.out.printlnSystem.out.printlnSystem.out.printlnSystem.out.println(a);(a);(a);(a);System.out.printlnSystem.out.printlnSystem.out.printlnSystem.out.println((((--------a);a);a);a);System.out.printlnSystem.out.printlnSystem.out.printlnSystem.out.println(a(a(a(a--------););););System.out.printlnSystem.out.printlnSystem.out.printlnSystem.out.println(a);(a);(a);(a);
77777777666666665555
![Page 34: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/34.jpg)
BBITWISEITWISE OOPERATORSPERATORS
OperatorOperatorOperatorOperator DescriptionDescriptionDescriptionDescription
<< left shift �#���#(���������&)��
>> right shift �#���#(���������&���
& bitwise AND
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
& bitwise AND
| bitwise OR
^ bitwise XOR
34
Chapter 2
Basic P
rogra
mming C
oncepts
��$�����*�&���������&����-�
,����*��������0�����*����1�2 �����&��"-��*��������
(Operand) �/(�/'�������-� Integer �#� Character
![Page 35: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/35.jpg)
BBITWISEITWISE OOPERATORSPERATORS
aaaa bbbb a &a &a &a & bbbb a |a |a |a | bbbb a ^ ba ^ ba ^ ba ^ b
1 1 1 1 0
1 0 0 1 1
0 1 0 1 1
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
0 1 0 1 1
0 0 0 0 0
35
Basic P
rogra
mming C
oncepts1 – Open (True)
0 – Close (False)
![Page 36: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/36.jpg)
BBITWISEITWISE OOPERATORSPERATORS Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
��*� ��� � a = 01000001, b = 00100001
a & ba & ba & ba & b
aaaa 0000 1111 0000 0000 0000 0000 0000 1111
36
Basic P
rogra
mming C
oncepts
aaaa
bbbb
0000 1111 0000 0000 0000 0000 0000 1111
&&&&
0000 0000 1111 0000 0000 0000 0000 1111
0000 0000 0000 0000 0000 0000 0000 1111
![Page 37: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/37.jpg)
BBITWISEITWISE OOPERATORSPERATORS Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
��*� ��� � a = 01000001, b = 00100001
a | ba | ba | ba | b
aaaa 0000 1111 0000 0000 0000 0000 0000 1111
37
Basic P
rogra
mming C
oncepts
aaaa
bbbb
0000 1111 0000 0000 0000 0000 0000 1111
||||
0000 0000 1111 0000 0000 0000 0000 1111
0000 1111 1111 0000 0000 0000 0000 1111
![Page 38: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/38.jpg)
BBITWISEITWISE OOPERATORSPERATORS Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
��*� ��� � a = 01000001, b = 00100001
a ^ ba ^ ba ^ ba ^ b
aaaa 0000 1111 0000 0000 0000 0000 0000 1111
38
Basic P
rogra
mming C
oncepts
aaaa
bbbb
0000 1111 0000 0000 0000 0000 0000 1111
^̂̂̂0000 0000 1111 0000 0000 0000 0000 1111
0000 1111 1111 0000 0000 0000 0000 0000
![Page 39: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/39.jpg)
BBITWISEITWISE OOPERATORSPERATORS Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
a << 2a << 2a << 2a << 2
aaaa 0000 0000 1111 0000 0000 0000 0000 1111
39
Basic P
rogra
mming C
oncepts
1111 0000 0000 0000 0000 1111 0000 0000
If x = 8 then y = x << 2 is thaty = 8 * 22 = 32
![Page 40: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/40.jpg)
BBITWISEITWISE OOPERATORSPERATORS Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
b >> b >> b >> b >> 3333
bbbb 0000 1111 0000 0000 0000 0000 0000 1111
40
Chapter 2
Basic P
rogra
mming C
oncepts
0000 0000 0000 0000 1111 0000 0000 0000
If x = 32 then y = x >> 2 is thaty = 32 / 22 = 8
![Page 41: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/41.jpg)
OPERATOR OF
Mr.W
ara
wut K
hangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
OPERATOR OF
PRCEDENCE
Chapter 2
Basic P
rogra
mming C
oncepts
41
![Page 42: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/42.jpg)
�#���(� ��)#���*����� �#�$�������#���(� ��)#���*����� �#�$������
���$�����*� ��%���+*�%!� ������*��������
(Operand) )�(&���0�� ��(&2 ��0������������*��������
������� ��(&��
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
��%�#(�& ���/(�/�*���%���+*�%!+-&����0�4����������:�
����
���5/�/(�%�#(�& ���/�*���%���+*�%!������ 0�������:�
0��)��4����
42
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 43: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/43.jpg)
�#���(!"� �� �#�$������ ������!#�
1 ( ), [ ] L � R
2 ++, --, !, ~ R � L
3 *, /, % L � R
4 +, - L � R
5 <<, >>, >>> L � R
6 <, <=, >, >= L � R
7 ==, != L � R
8 & L � R
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
8 & L � R
9 ^ L � R
10 | L � R
11 && L � R
12 || L � R
13 ?: L �R
14 =, +=, -=, *=, /=, %=, <<=, >>=, >>>=, &=, ^=, !=
R� L
43
Basic P
rogra
mming C
oncepts
![Page 44: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/44.jpg)
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
a + b * c = ?
a = 5, b = 2, c = 10
70 2525
(a + b) * c = ? 70 2570
Chapter 2
Basic P
rogra
mming C
oncepts
44
![Page 45: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/45.jpg)
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
a + b * c + d = ?
a = 5, b = 2, c = 10, d = 3
73 2828
(a + b) * c + d = ? 73 2873 Basic P
rogra
mming C
oncepts
45
(a + b) * (c + d) = ? 73
a + (b * c) + d = ? 28
![Page 46: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/46.jpg)
DATA TYPE
Mr.W
ara
wut K
hangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
DATA TYPE
CONVERSION
Chapter 2
Basic P
rogra
mming C
oncepts
46
![Page 47: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/47.jpg)
��������������������������������������
� Implicit Type Conversion - ���/(�'�������-�� �
,���,����
�Explicit Type Conversion - ���/(�'�������-�,�
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
:-���/�,������
47
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 48: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/48.jpg)
IIMPLICITMPLICIT TTYPEYPE
CCONVERSIONONVERSION
�'�����&����-����&��$�'�������-���/���
����/(�'�������-�0����������4���$������ !� �������
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
48
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 49: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/49.jpg)
EEXPLICITXPLICIT TTYPEYPE
CCONVERSIONONVERSION
�'�����&����-����&��$�'�������-���/���
����/(�'�������-�0����������4���$������ !� �������
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
valNameResult = (dataType) valName
49
Chapter 2
Basic P
rogra
mming C
oncepts
valNameResult = (dataType) valName
valNameResult = ���� ���!"���(���&���������������
dataType = �������������� ���
valName = ���� ���!"���������������������
![Page 50: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/50.jpg)
EX. CODE EXPLICIT TYPE
CONVERSION Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
50
Basic P
rogra
mming C
oncepts
![Page 51: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/51.jpg)
EEXPLICITXPLICIT TTYPEYPE
CCONVERSIONONVERSION
����0��������/(�'�������-�,�:-���/�,��������& �����
����������-��/(��$���������� �#�������� Java &
��1!��� ��/������/(�%��'�������-�+������
(Character) � ���$������ �#����/(�%��'�������-�
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
(Character) � ���$������ �#����/(�%��'�������-�
������ ���$�������� ,��'���9�� (Method) ��%��+
(Class) Wrapper )�(&��$� class �/(+���9�������-�
'����#��.�� (Primitive Data Type)
51
Basic P
rogra
mming C
oncepts
![Page 52: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/52.jpg)
����������� METHOD ���� CLASS
WRAPPER
Class Class Class Class WrapperWrapperWrapperWrapper
Primitive Primitive Primitive Primitive Data TypeData TypeData TypeData Type
MethodMethodMethodMethod !"���$��"����+�$�,�
�� $��
MethodMethodMethodMethod !"���$��"����+�$�,�
)��������
Integer int Integer.parseInt( ) Integer.toString( )
Float float Float.parseFloat( ) Float.toString( )
Double double Double.parseDouble( ) Double.toString( )
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
Double double Double.parseDouble( ) Double.toString( )
52
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 53: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/53.jpg)
EX. CODE CLASS WRAPPER Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
53
Basic P
rogra
mming C
oncepts
![Page 54: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/54.jpg)
DATA OUTPUT
Mr.W
ara
wut K
hangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
DATA OUTPUT
& INPUT
Basic P
rogra
mming C
oncepts
54
![Page 55: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/55.jpg)
����)��-��������� �$�.������)��-��������� �$�.��PRINTLNPRINTLN
�Method println( ) �#� print( ) �+�&:�����-���&0����
� �-��� Object out ��& Class System
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
System.out.println(arg1 + arg2 + … + arg_n);or
55
Chapter 2
Basic P
rogra
mming C
oncepts
orSystem.out.print(arg1 + arg2 + .. + arg_n);
arg1, arg2, arg_n = $�,�������!"���������)��-�
![Page 56: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/56.jpg)
�+�)� (�/�����)��-��� ���(�+�)� (�/�����)��-��� ���(ARGUMENTARGUMENT
������%�$�� � ��+���
\b ��#(�� cursor "� �&4� 1 ���� �
\f ���� ���� ��
\n ���������� ��
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
\n ���������� ��
\r ��#(�� cursor 4���&)��+1�
\t �+�&�������������
\’ �+�&�%�#(�& �� ‘
\” �+�&�%�#(�& �� ”
\\ �+�&�%�#(�& �� \
\xxx �+�&���� �� + Ascii �'�� \065 %#� A
\uxxx �+�&���� ��� + Unicode �'�� \u0008 %#� ���������� ��
56
Basic P
rogra
mming C
oncepts
![Page 57: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/57.jpg)
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
57
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 58: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/58.jpg)
����)��-��������� �$�.������)��-��������� �$�.�� PRINTFPRINTF
�Method printf( ) �+�&:�����-���&0����
� �-��� Object out ��& Class System
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
System.out.printf(Control_String, arg1 + arg2 + … + arg_n);
58
Chapter 2
Basic P
rogra
mming C
oncepts
+ … + arg_n);
Control_String = �����(�� ��+�)� (�/�����)��-�,
�+�)����)��-�
���)� ������+�)����)��-�
arg1, arg2, arg_n = $�,�������!"���������)��-�
![Page 59: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/59.jpg)
�+�)����)��-�����+�)����)��-���� MMETHODETHOD
PRINTFPRINTF
�+�)����)��-� ������������!"���
%c �������
%d ���0*��������
%f ����3���
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
%f ����3���
%e ������-� exponential
%s ���%���
%u ���0*��������4��%���%�#(�& ��
59
Basic P
rogra
mming C
oncepts
![Page 60: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/60.jpg)
)� ������+�)����)��-����)� ������+�)����)��-����MMETHODETHOD PRINTFPRINTF
)� ����� �����$�"����������
- � ��+�&:�0��)��4����
+ � ��+�&:�0�����4�)��
����� �*� ��0*�����*�� ��&+*� ������+�&:�
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
����� �*� ��0*�����*�� ��&+*� ������+�&:�
"����$�����+�&:�0�������)�� ���0*��������-��/(�+�&:��������
0*�����*�� ��&0�����+����/(� �#����)�����'��&���&
. (01��3���) �*� ���-��������+�&:�� ��/01��3���
60
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 61: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/61.jpg)
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
61
Basic P
rogra
mming C
oncepts
![Page 62: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/62.jpg)
����)��-��������� ����)����)��-��������� ����)JOJOPTIONPTIONPPANEANE
�Class JOptionPane �+�&:�����-����-������&
Graphic Mode ,��+�&��������� 5���& Popup
Window �/(��/���� Dialogbox ������
MessageDialog )�(&��/��'�&��0�� method
showMessageDialog( ) �/(4���/���%#�%��
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
showMessageDialog( ) �/(4���/���%#�%��
� ����'�&�� Class JOptionPane 0����&+���& Object 0��
Class JOptionPane �����+�� )�(&���& import class
�/�0�� package javax.swing �������� project
62
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 63: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/63.jpg)
����)��-��������� ����)����)��-��������� ����)JOJOPTIONPTIONPPANEANE M
r.Wara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
JOptionPane.showMessageDialog(Parent_Window, Message, Title, Type);
Parent_Window = $�,������+�������!"��������
63
Basic P
rogra
mming C
oncepts
Parent_Window = $�,������+�������!"��������
�)��-�����1"!"��#�+�����$�,�
null &��)�� Dialog box
����+���&�
Message = $�,����� ��!"��)���� Dialog box
Title = $�,����� ��!"�����2��)� ���� Title bar
![Page 64: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/64.jpg)
����)��-��������� ����)����)��-��������� ����)JOJOPTIONPTIONPPANEANE M
r.Wara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
Type = $�,������� Dialog box 34��&�5���#�+��6��
�����!"����7��"�
• ERROR_MESSAGE - �)�������1����-��%���
• INFORMATION_MESSAGE - �)��������1�
64
Chapter 2
Basic P
rogra
mming C
oncepts
• INFORMATION_MESSAGE - �)��������1�
���� ��!�� 7�
• PLAIN_MESSAGE - �)��������1����� ��!�� 7� 6��
7���"����)��)�*����1'
• QUESTION_MESSAGE - �)��������1��#�5��
• WARNING_MESSAGE - �)��������1��&��$���
![Page 65: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/65.jpg)
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
65
Basic P
rogra
mming C
oncepts
![Page 66: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/66.jpg)
���&������((����)��-������ $���� ����)���&������((����)��-������ $���� ����)
DDECIMALECIMALFFORMATORMAT
���$����0��-��������+�&:���&�����
�����'�0����&+���& Class DecimalFormat �����+��
)�(&���& import package java.text ����4���Project
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
Project
66
Basic P
rogra
mming C
oncepts
![Page 67: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/67.jpg)
����((������������((��������
DDECIMALECIMALFFORMATORMAT Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
DecmialFormat df = new DecimalFormat(arg);String str = df.format(payment);
arg = $�,�����((����)��-�!"�������� 34�������(�� �
0 0
67
Chapter 2
Basic P
rogra
mming C
oncepts
• 0 �!��� $�� 0 !"���������)���� $��
• “#” �!��� $����8 !"�7���� 0 ����1"!"�$�,� 0 &�
7���)��-�
• “,” $�,��� ������+���%��
df = $�,��� object ��� class !"�)�����4��
str = $�,����� ���!"�����(���!"��#�+������((���
![Page 68: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/68.jpg)
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
68
Basic P
rogra
mming C
oncepts
![Page 69: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/69.jpg)
�����(�������� ����)�����(�������� ����)
IINPUTNPUTSSTREAMTREAMRREADEREADER
�Class InputStreamReader 0���$�����*�&��
������ Class BufferedReader ,������
����-�%��&�� 1 ����� 0��'� Method readLine( )
)�(&��$����������-�'������%��� (String)
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
)�(&��$����������-�'������%��� (String)
����& import package java.io �����+��
69
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 70: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/70.jpg)
����((������������((��������
IINPUTNPUTSSTREAMTREAMRREADEREADER Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
InputStreamReader rd = new InputStreamReader(System.in);BufferedReader stdin = new BufferedReader(rd);
ororororBufferedReader stdin = new InputStreamReader(
new InputStreamReader(System.in));
70
Basic P
rogra
mming C
oncepts
reader = $�,��� object ��� class InputStreamReader
stdin = $�,��� object ��� class BufferedReader
![Page 71: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/71.jpg)
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
71
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 72: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/72.jpg)
�����(�������� ����)�����(�������� ����) SSCANNERCANNER
�+����"������-��/(�/'�����&����-���$����%��� �#��������
4��
�����'�&��%��+ Scanner ���&+���& object 0�� class
Scanner
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
Scanner �����+��
� import package java.util
72
Basic P
rogra
mming C
oncepts
![Page 73: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/73.jpg)
����((���)����((���) SSCANNERCANNER
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
Scanner sn = new Scanner(System.in);
sn = $�,��� objectobjectobjectobject !"�)����&�� class class class class ScannerScannerScannerScanner
System.in = $�,����!������#�$�������������9�� +���54�
73
Basic P
rogra
mming C
oncepts
$�,����!������#�$�������������9�� +���54�
�������������&����:�%��%'
MethodMethodMethodMethod
•nextInt( ) ��(���������$�! Integer
•nextFloat( ) ��(���������$�! Float
•nextDouble( ) ��(���������$�! Double
•nextLine( ) ��(����������$�! String
![Page 74: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/74.jpg)
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
74
Basic P
rogra
mming C
oncepts
![Page 75: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/75.jpg)
�����(�������� ����)�����(�������� ����)
JOJOPTIONPTIONPPANEANE
��'� Method showInputDialog( ) �/(%#�%�������
��$�����-�'������%��� (String)
�����'�&��%��+ JOptionPane ���&+���& object 0��
class JOptionPane
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
class JOptionPane �����+��
� import package javax.swing
75
Chapter 2
Basic P
rogra
mming C
oncepts
![Page 76: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/76.jpg)
����((���)����((���) JOJOPTIONPTIONPPANEANE
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
JOptionPane.showInputDialog(Parent_Window, Message, Title, Type);
Parent_Window = $�,������+�������!"��������
76
Basic P
rogra
mming C
oncepts
Parent_Window = $�,������+�������!"��������
�)��-�����1"!"��#�+�����$�,�
null &��)�� Dialog box
����+���&�
Message = $�,����� ��!"��)���� Dialog box
Title = $�,����� ��!"�����2��)� ���� Title bar
![Page 77: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/77.jpg)
����((���)����((���) JOJOPTIONPTIONPPANEANE
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
Type = $�,������� Dialog box 34��&�5���#�+��6��
�����!"����7��"�
• ERROR_MESSAGE - �)�������1����-��%���
• INFORMATION_MESSAGE - �)��������1�
77
Chapter 2
Basic P
rogra
mming C
oncepts
• INFORMATION_MESSAGE - �)��������1�
���� ��!�� 7�
• PLAIN_MESSAGE - �)��������1����� ��!�� 7� 6��
7���"����)��)�*����1'
• QUESTION_MESSAGE - �)��������1��#�5��
• WARNING_MESSAGE - �)��������1��&��$���
![Page 78: Object-Oriented Programming 2](https://reader034.fdocuments.us/reader034/viewer/2022051323/546b8c0cb4af9f662c8b4d63/html5/thumbnails/78.jpg)
Mr.W
ara
wut
Khangkhan
Chapter 2
Basic P
rogra
mming C
oncepts
78
Basic P
rogra
mming C
oncepts