vii
Sams.net Learning Center
abcd
P2/V4SQC6 TY Java in 21 Days 030-4 louisa 12.31.95
FM LP#4
M
T
W
R
F
S
S
Overview
Introduction
xxi
Week 1 at a Glance
Day
1
An Introduction to Java Programming
3
2
Object-Oriented Programming and Java
19
3
Java Basics
41
4
Working with Objects
61
5
Arrays, Conditionals, and Loops
79
6
Creating Classes and Applications in Java
95
7
More About Methods
111
Week 2 at a Glance
Day
8
Java Applet Basics
129
9
Graphics, Fonts, and Color
149
10
Simple Animation and Threads
173
11
More Animation, Images, and Sound
195
12
Managing Simple Events and Interactivity
217
13
User Interfaces with the Java Abstract Windowing Toolkit
237
14
Windows, Networking, and Other Tidbits
279
Week 3 at a Glance
Day
15
Modifiers
305
16
Packages and Interfaces
323
17
Exceptions
341
18
Multithreading
353
19
Streams
375
20
Native Methods and Libraries
403
21
Under the Hood
421
Appendixes
A
Language Summary
473
B
The Java Class Library
483
C
How Java Differs from C and C++
497
D
How Java Differs from C and C++
507
Index
511
030-4 FM
1/29/96, 8:11 PM
7
ix
Sams.net Learning Center
abcd
P2/V4SQC6 TY Java in 21 Days 030-4 louisa 12.31.95
FM LP#4
M
T
W
R
F
S
S
Contents
Introduction
xxi
Week 1 at a Glance
1
Day
1
An Introduction to Java Programming
3
What Is Java? .............................................................................................. 4
Java’s Past, Present, and Future ................................................................... 6
Why Learn Java? ......................................................................................... 7
Java Is Platform-Independent................................................................. 7
Java Is Object-Oriented ......................................................................... 9
Java Is Easy to Learn .............................................................................. 9
Getting Started with
Programming in Java .............................................................................. 10
Getting the Software ............................................................................ 10
Applets and Applications ..................................................................... 11
Creating a Java Application .................................................................. 11
Creating a Java Applet ......................................................................... 13
Summary .................................................................................................. 16
Q&A ........................................................................................................ 16
Day
2
Object-Oriented Programming and Java
19
Thinking in Objects: An Analogy ............................................................. 20
Objects and Classes .................................................................................. 21
Behavior and Attributes ............................................................................ 23
Attributes ............................................................................................. 23
Behavior .............................................................................................. 24
Creating a Class ................................................................................... 24
Inheritance, Interfaces, and Packages ........................................................ 28
Inheritance........................................................................................... 29
Creating a Class Hierarchy ................................................................... 30
How Inheritance Works ...................................................................... 32
Single and Multiple Inheritance ........................................................... 34
Interfaces and Packages ........................................................................ 34
Creating a Subclass ................................................................................... 35
Summary .................................................................................................. 38
Q&A ........................................................................................................ 39
Do'stlaringiz bilan baham: