没有合适的资源?快使用搜索试试~ 我知道了~
首页The art and science of java
The art and science of java

An very good book from Stanford University. There is free video on internet which is based on this book.
资源详情
资源评论
资源推荐

The Art & Science
of
ava'
An
Introduction
ERIC
S.
ROBERTS
to Computer Science
Stanford University
Boston San Francisco
New
York
London Toronto
Sydney Tokyo Singapore Madrid
Mexico
City
Munich Paris Cape Town
Hong
Kong Montreal

Contents
x
~rriltr©dyd'~@~1
1.1
A brief history of computing 2
1.2
What
is
computer science? 4
1.3 A brief tour of computer hardware 5
The
CPU
6, Memory 7, storage
7,
Input/output
devices 7, Network 8
1.4 Algorithms 8
1.5 Stages
in
the progromming process 9
Creating and editing programs 9, Programming
errors
and
debugging
12, Software maintenance 13
1.6 Java
and
the object-oriented paradigm
15
The
history
of programming 15,
The
Java
programming language 16
1.7 Java
and
the World Wide
Web
17
Summary
21
Review
questions
22
:2
IdJ
rr©g
tr«1l
D1l1HJ(~
n
1l19j
2.1
The
"Hello world" program
24
Comments
25,
Imports
26,
The
main
class
26,
2.2 Perspectives on the programming process
28
2.3 A program
to
add
two numbers
30
2.11
Programming idioms ond patterns
34
2.5 Classes
and
objects
36
Class
hierarchies
Program
class
hierarchy
38
2.6 Graphical programs
39
The
HelloProgram
revisited
40,
Sending
messages
to
GObjeets
40,
The
GObjeet
class
hierarchy
43,
The
GReet
class
44,
GOval
class
48,
The
GLine
class
49
Summary
51
Review
questions
52
Programming exercises
53
3.1
Primitive
data
types
59
3.2 Constants
and
variables
61
Constants
61,
Variables
62,
Declarations
63,
Named
constants

Operators and operands
65
Combining
integers
and floating-point
numbers
66,
Integer
division and
the
remainder operator
67,
Precedence
68,
Applying
rules
of precedence
70,
Type
conversion
71
3.4 Assignment
statements
73
Shorthand assignment
76,
increment and
decrement operators
Boolean expressions
77
Relational operators
78,
Logical operators
78,
Short-circuit
evaluation 81,
Flags
82,
An
example of Boolean
calculation
82
3.6 Designing for change
83
The
importance of readability 83,
named
constants
to
support program maintenance 84,
Using
named
constants
to
support program development
85
Summary
88
Review questions
89
Programming
exercises
91
Statement
types
in
Java
96
Simple
statements
96,
Compound
statements
98,
Control
statements
98
4.2 Control
statements
and problem
solving
99
Generalizing
the
Add2Integers
program 100, repeat-N-
times
pattern
101,
read-until-sentinel
pattern
102
The
if
statement 1
05
Single-line
if
statements
107, Multiline
if
statements
107,
The
if-else
statement
107, Cascading
if
statements
107,
The?:
operator 1
08
4.4 The
switch
statement
110
4.5 The
while
statement
112
Using
while
loop 113, Infinite loops 114,
the
loop-
and-a-half problem
115
4.6
The
for
statement
11
8
relationship between
for
and
while
120,
Using
for
with
fioating-point data 120, Nested
for
statements
121, Simple
graphical animation 1 22
Summary
126
Review
questions
126
Programming exercises
127
xi

.5
xii
5.1
A quick overview
of
methods 134
Methods
as
complexity I
35,
Methods
as
for
than
users
1
35,
Method calls
as
as
messages 1 37
5.2
Writing your
own
methods 138
format
of
a 139,
return
statement
139,
structures
141, Methods that
return
nonnumeric methods 144
5.3
Mechanics of the method-calling process 147
Parameter 1 methods
from
within other
methods
5.4 Decomposition 158
Stepwise 1 Specifying parameters 161,
Designing
the
top down 163, Looking for common
features
164, Completing decomposition 165
5.5 Algorithmic methods 166
The
"brute force" 1 algorithm 168,
Defending
the
of algorithm 168, Comparing
the
efficiency
of
the
two algorithms 170
Summary 170
Review
questions
171
Programming exercises 172
~"b.!J
0:
- n
Ulidl~e(ij'~
{nlii[i]
6.1
Using
the
RandomGenerator
class 178
Pseudorandom numbers 179,
RandomGenerator
class 180,
The
role
of
random 183
6.2
The
java doc documentation
system
185
6.3
Defining
your
own
classes 188
The
structure
of
a
closs
1
entries
189, Encapsulation 189
6.4
Representing student information 190
Declaring instance variables 190,
definition 191, Writing
javadoc
comments
constructor
194,
Getters and
setters
1
method
196, Defining named constants
in
a
the
Student
closs
198
6.5
Rational
numbers 199
6.6
Extending
existing classes 204
Creating a
closs
to
represent filled rectangles
inherited constructors 208,
Rules
for
inherited
Summary
211
Review
questions 213
Progromming exercises 214
visibility
of

Olbjed's
7.1
The
structure
of
memory
222
7.2
7.3
7.4
Bits,
bytes,
and words
222,
Binary and hexadecimal
representations
223,
Memory
addresses
225
The
allocation
of
memory
to
variables
226
Memory diagrams for
the
Rational
class
227, Garbage
collection
232
Primitive
types
versus
objects
232
Parameter
passing
234,
Wrapper
unboxing
238
236,
Boxing and
Linking
objects
together
240
Message
passi~g
in
linked
structures:
The
beacons
of
Gondor
240,
rhe
internal representation of linked
structures
243
Summary
244
Review
questions
245
Programming
exercises
247
8
StrsHilgs
249
8.1
The
principle
of
enumeration
250
Representing
enumerated
types
inside machine
251,
Representing
types
as
252,
Defining new
enumerated
types
253
8.2
Characters
254
The
type
char
254,
ASCII
and Unicode coding
systems
254,
Character
constants
257,
Important properties of
the
Unicode representation
257,
Special characters
258,
Character arithmetic
Useful
methods
in
the
Character
class
261,
Control
statements
involving characters
263
8.3
Strings
as
an
abstract
idea
263
Holistic and reductionist views
of
strings
264,
The
notion
of
an
abstract
264
8.4
Using
the
methods
in
the
String
class
265
Determining
the
length
of a
string
265,
Selecting characters
from
a
string
267,
Concatenation
267,
Extracting
ports
of a
string
269,
Comparing one
string
with another
270,
Searching
within a
string
271,
Case conversion
273
8.5 A
case
study
in
string
processing
273
Applying top-down design Implementing
translateLine
275, Taking spaces and punctuation into
account
276,
The
StringTokenizer
278, Completing
the
implementation
280
Summary
284
Review
questions
284
Programming
exercises
286
xiii
剩余586页未读,继续阅读












安全验证
文档复制为VIP权益,开通VIP直接复制

评论1