P. 1
Java to an Tap

# Java to an Tap

Ratings: (0)|Views: 4|Likes:

Published by: cuongnguyenptit on Nov 23, 2010

### Availability:

Read on Scribd mobile: iPhone, iPad and Android.
See more
See less

11/07/2011

pdf

text

original

Trang1
Tr-êng ®¹i häc s- pm kü thuËt h-ng n
khoa c«ng nghÖ th«ng tin
---------------ooo------------------
§Ò c-¬ng bµi gi¶ng Java
Nhóm biên so
n: 1. Hoàng Tr
ng Th
2. Nguy
n Duy Tân

Trang2

C L
C
Ch

ng 1: CÁC KHÁI NI
M C
B
N..................................................................5BÀI 1. LÀM QUEN V
I JAVA...................................................................................5I. L
ch s
java...........................................................................................................5II. Java em ai.........................................................................................................5II. M
t s

c tr
ng c
a java.....................................................................................5III. Các ki
u
ng d
ng Java........................................................................................7IV. Máy
o Java (JVM-Java Virtual Machine)..........................................................7BÀI 2 N
N T
NG C
A JAVA................................................................................9I. T
p ký t
dùng trong java......................................................................................9II. T
khoá c
a Java..................................................................................................9III.

nh danh (tên).................................................................................................10IV. C
u trúc m
t ch

ng trình java.........................................................................10V. Ch

ng trình JAVA

u tiên..............................................................................12VI. Chú thích trong ch

ng trình............................................................................14VII. Ki
u d
li
u.....................................................................................................15VII. M
t s
phép toán trên ki
u d
li
u nguyên thu
...............................................17IX. Toán t
chuy
n ki
u..........................................................................................23X. Các hàm toán h
c...............................................................................................24XI. Các phép toán trên ki
u kí t
.............................................................................26BÀI 3.
I
U KHI
N LU
NG CH

NG TRÌNH....................................................27I. C
u trúc r
nhánh.................................................................................................27II. C
u trúc l
p while và do-while...........................................................................30III. C
u trúc for.......................................................................................................32IV. L
nh break và continue.....................................................................................34Ch

ng 2: L
P TRÌNH H

NG

I T

NG.........................................................37BÀI 1.

NH NGH
A L
P.......................................................................................38I. Khai báo l

p........................................................................................................38II. Chi ti
t v
khai báo m
t ph

ng th
c.................................................................40III. T
khoá this......................................................................................................43IV. T
khoá super...................................................................................................43V. S
d
ng l

p........................................................................................................44VI.
i
u khi
n vi
c truy c
p

n các thành viên c
a m
t l

p..................................44BÀI 2. KH
I

U VÀ D
N D
P............................................................................47I. Ph

ng th
c t
o d
ng (constructor).....................................................................47II. Kh
i kh

i

u vô danh và kh
i kh

i

u t

nh......................................................49III. D
n d
p: k
t thúc thu rác..............................................................................51BÀI 3. CÁC THÀNH PH
N T
NH...........................................................................52I. Thu
c tính t

nh....................................................................................................52II. Ph

ng th
c t

nh................................................................................................52BÀI 4. N
P CH
NG PH

NG TH

C..................................................................53I. Khái ni
m v
ph

ng th
c b
i t
i........................................................................53

Trang3
II. Yêu c
u c
a các ph

ng th
c b
i t
i...................................................................53BÀI 5. K
TH

A (INHERITANCE)........................................................................54I. L

p c

s

và l

p d
n xu
t....................................................................................54II. Cách xây d
ng l

p d
n xu
t................................................................................54III. Th
a k
các thu
c tính......................................................................................54IV. Th
a k
ph

ng th
c........................................................................................54V.Kh

i

u l

p c

s

.............................................................................................54VI. Ghi
è ph

ng th
c ( Override ).......................................................................56VI. Thành ph
n protected........................................................................................56VII. T
khoá final...................................................................................................56BÀI 6. L
P C
S
TR

U T

NG.........................................................................61BÀI 7.
A HÌNH THÁI............................................................................................62BÀI 8. GIAO DI
N, L
P TRONG, GÓI...................................................................63I. Giao di
n.............................................................................................................63II. L

p trong............................................................................................................65Bài 9. M
NG, XÂU KÝ T

, T
P H
P...................................................................67I. M
ng...................................................................................................................67II. Xâu ký t
............................................................................................................70III. L

p StringTokenizer.........................................................................................75IV. M
t s
l

p c

b
n c
a Java...............................................................................77V. cl

p t
p h

p..................................................................................................83Ch

ng 3: X

LÝ NGO
I L
............................................................................92I. M
c
ích c
a vi
c x
lý ngo
i l
..........................................................................92II. Mô hình s
lý ngo
i l
c
a java..........................................................................92III.

c t
ngo
i l
...................................................................................................93III. Ném ra ngo
i l
.................................................................................................93IV. B
t ngo
i l
.......................................................................................................93V. Kh
i ‘finally......................................................................................................95VI. M
t s
l

p ngo
i l
chu
n c
a Java...................................................................96Ch

ng 4: L
P TRÌNH
A TUY
N........................................................................97I. Các ki
n th
c liên quan........................................................................................97II. L
p trình
a tuy
n trong Java..............................................................................98Ch

ng 5: NH
P XU
T (Input/Output)...............................................................104I. L

p lu
ng..........................................................................................................105II. L

p File............................................................................................................113Ch

ng 6: L
P TRÌNH

HO
AWT................................................................120I. Gi

ithi
u v
h
th
ng

ho
c
a Java..............................................................120II. Trình qu
n lý hi
n th
trong Java......................................................................124III. X
lý s
ki
n trong Java..................................................................................125Ch

ng 7 L
P TRÌNH C
S
D

LI
U..............................................................143I. T
ng quan143II. Các k
u trình
i
u khi
n JDBC.........................................................................143

## Activity (1)

You've already reviewed this. Edit your review.