Professional Documents
Culture Documents
Index and Last Pages Javabook
Index and Last Pages Javabook
Index and Last Pages Javabook
zero fill right shift operator >>> 531 print(), AmericanTime method 425
ounces, unit of weight 319 print(), EnglishCalendar method 395
out, static field of class System 333 print(), European time method 425
output parameters 260 print(), PrintStream method 333
output statements 12 print(), Window method 407
output, formatting 116 print_all_items(), Collection method 485
outputting data to caller 254 print_array() method 506
overloading print_array(), overloaded method 284
method overloading vs. polymorphic methods 415 print_array_of_numbers() method 265
overloading constructors 306 print_calculations() method 280
overloading method names 282 print_data_of_collection_items() method 492
overriding methods 414 print_data_of_next_president() method 375
print_in_binary_form() method 536
print_lowercase_letters() method 243
P print_message() method 241
package keyword 568 print_olympics_data(), Olympics method 313
packages 334, 398 print_person_data(), Person method 298
default package 336 print_planet_data(), Planet method 321
java.io package 460 print_rectangle(), Rectangle method 292
java.lang package 335 print_sum() method 246
java.util package 335 print_text_in_decorated_box() method 248
palindromes 206 print_uppercase_letters() method 243
palmtop computer 65 printf() method 116, 523
paper copies of programs 577 printf(), PrintStream method 333
parameters 244–261 printing date and time information 526
actual parameters 250, 268 printing programs on paper 577
arrays as method parameters 257 println(), PrintStream method 333
formal parameters 250, 268 println(), PrintWriter method 455, 461
input parameters 261 printStackTrace(), method of class Throwable 441
object references as parameters 379 PrintStream class 333
output parameters 260 PrintWriter class 454, 460
parameters for method main() 278 println() method 455, 461
passing by reference 245 private keyword 298, 398, 568
passing by value 245 processes 538
to instance methods 296 processors 56
varying in number 274 program blocks, nesting 276
parameters vs. arguments 250 program control 242
parentheses, meaning in expressions 113, 123 program counter 268, 269
parseDouble(), method of class Double 433, 565 program descriptions, structure of viii
parseInt(), method of class Integer 351, 433, 565 program development, incremental 576
parsing 433 program editors 9, 27
percent sign % in format specifiers 125 program listings 577
Person, an example class 298 program not working, what to do 574, 575
personal computers 65 program pointer register 268, 269
pints, unit of volume 319 program versions 577
Planet, an example class 321 programmers 9
polymorphic methods 414, 504, 510 programming exercises, list of xvii
calling superclass version of a method 419 programming exercises, practical advice for 29, 571
polymorphic methods vs. method overloading 415 programming languages 8
pop(), Stack method 330 assembly languages 94
Pope Gregory XIII 347 high-level languages 94
pounds, unit of weight 319 programming style
precedence of operators 112, 145, 559 see also "natural naming"
precision, of floating-point variables 107 indentation of statements 167
prefix 0x in hexadecimal literals 117 loops and if constructs 571
President, an example class 368 order of class members 316
PresidentInfoApplication, an example class 370 rules for using braces { } 167
print() method 103 programs
print(), abstract CurrentTime method 424 executable programs 8
Index Q 589
Q S
quotes, see "double quotes" or "single quotes" Scanner class 118, 120, 333, 522
findInLine() method 169
nextByte() method 118
R nextDouble() method 118
ragged arrays 196 nextFloat() method 118
RAM, random access memory 5, 50 nextInt() method 120
random numbers, generation of 447 nextLine() method 120, 490
read(), FileInputStream method 469, 470 nextLong() method 118
readability of programs 109 nextShort() method 118
readInt(), DataInputStream method 482 Schwarzenegger, Arnold 519
readLine(), BufferedReader method 454, 459 scope of variables 276, 561
readUTF(), DataInputStream method 482 scope, class scope 277
recompiling programs 26 screen output, directing to file 399
Rectangle, an example class 292 screen output, formatting 116
rectangular arrays 196 search_item_with_name(), Collection method 484
redefined (rewritten) methods 414 search_largest_integer() method 256, 380
reference types 324 search_president_by_name() method 373
reference types vs. value types 200 search_president_for_given_date() method 374
references search_string_in_file() method 462
object references 291 searching for errors in programs 574, 575
passing parameters by reference 245 selections, see "if constructs", "switch-case constructs"
string references 200 semicolon ; 14, 18
used as method parameters 379 serialization of objects 569
vs. objects 238 server computer 65
referencing objects 295, 300, 404, 427 set(), ArrayList method 507
this keyword 362 set_value(), IntParameter method 380
referring to array elements 178 setCharAt(), StringBuilder method 227
regionMatches() String method 213, 224 setOut(), PrintStream method 333
registers, in imaginary processor 56 setter methods 339
registers, in typical processor 269 shallow copy of an object 434
regular expressions 223, 234, 235 shift operations, shifting bits 534
relational expressions 141 short keyword 569
relational operators 135 short type 105
remainder operator % 138, 265, 280 Short, standard wrapper class 433
remove_all_items(), Collection method 485 show_account_data(), BankAccount method 296, 302, 416
remove_collection_item() method 491 signature of a method 259
remove_one_item(), Collection method 486 simulation 80
repetitions, see "loops" simultaneous execution of programs 538
replace() String method 215, 224, 465 sine of an angle 447
replace(), StringBuilder method 229 single quote character ’ 141, 203, 555
replace_string_in_file() method 465 size() method of ArrayList 503
reserved words 108 sleep(), method of class Thread 540, 546
reserved words (keywords), summary of 567 software 4
RestrictedAccount, an example class 419 software development, incremental 576
return keyword 569 sort(), Collections method 518
return statements 255 sort_to_ascending_order() method 266
590 S Index
W
warnings given by compiler 573
was_president_on(), President method 369
weak typing 267
week numbers 358
while keyword 569
while loops 152–157, 561
whitespace characters 225
whole numbers (integers) 14
Window, an example class 406
Windows operating system 4
Windows XP operating system 538
windows, character-based 404
Windows/MS-DOS operating system 453
withdraw_money(), BankAccount method 303, 417
withdraw_money(), redefined method 418, 419
workstation 65
World Calendar 347
write(), FileOutputStream method 471
writeInt() and other DataOutputStream methods 476
writeInt(), DataOutputStream method 482
writeUTF(), DataOutputStream method 477, 483
writing about objects and their references 238
Y
yards, unit of distance 115, 319
year(), Date method 351
year, definition of 342
Z
zero fill right shift operator >>> 531
.zip files, unzipping (extracting files) 23
593
USEFUL TABLES
On the following pages, you will find tables that are useful when you work with computer
programs. Don’t hesitate to use this page to write down important information that you
need to remember in your programming work.
594 Useful tables
0 00 NULL 48 30 0 96 60 ‘
1 01 49 31 1 97 61 a
2 02 50 32 2 98 62 b
3 03 51 33 3 99 63 c
4 04 52 34 4 100 64 d
5 05 53 35 5 101 65 e
6 06 54 36 6 102 66 f
7 07 BELL 55 37 7 103 67 g
8 08 BACKSPACE 56 38 8 104 68 h
9 09 TABULATOR 57 39 9 105 69 i
10 0A NEWLINE,LF 58 3A : 106 6A j
11 0B 59 3B ; 107 6B k
12 0C 60 3C < 108 6C l
13 0D CR 61 3D = 109 6D m
14 0E 62 3E > 110 6E n
15 0F 63 3F ? 111 6F o
16 10 64 40 @ 112 70 p
17 11 65 41 A 113 71 q
18 12 66 42 B 114 72 r
19 13 67 43 C 115 73 s
20 14 68 44 D 116 74 t
21 15 69 45 E 117 75 u
22 16 70 46 F 118 76 v
23 17 71 47 G 119 77 w
24 18 72 48 H 120 78 x
25 19 73 49 I 121 79 y
26 1A 74 4A J 122 7A z
27 1B ESCAPE 75 4B K 123 7B {
28 1C 76 4C L 124 7C |
29 1D 77 4D M 125 7D }
30 1E 78 4E N 126 7E ~
31 1F 79 4F O 127 7F DELETE
32 20 SPACE 80 50 P
33 21 ! 81 51 Q
34 22 " 82 52 R
35 23 # 83 53 S
36 24 $ 84 54 T In the first column:
LF = Line Feed
37 25 % 85 55 U
CR = Carriage Return
38 26 & 86 56 V
39 27 ’ 87 57 W
40 28 ( 88 58 X You get the 2-byte (16-bit)
41 29 ) 89 59 Y Unicode character codes of
42 2A * 90 5A Z these 1-byte codes if you add
43 2B + 91 5B [ 8 zero bits before each code.
44 2C , 92 5C \
45 2D - 93 5D ]
46 2E . 94 5E ^
47 2F / 95 5F _
595
20 1 1H
21 2 2H
22 4 4H
23 8 8H
24 16 10H
25 32 20H
26 64 40H
27 128 80H
28 256 100H
29 512 200H
210 1024 400H 1 k
211 2048 800H 2 k
212 4096 1000H 4 k
213 8192 2000H 8 k
214 16384 4000H 16 k
215 32768 8000H 32 k
216 65536 10000H 64 k
217 131072 20000H 128 k
218 262144 40000H 256 k
219 524288 80000H 512 k
220 1048576 100000H 1 M
221 2097152 200000H 2 M
222 4194304 400000H 4 M
223 8388608 800000H 8 M
224 16777216 1000000H 16 M
225 33554432 2000000H 32 M
226 67108864 4000000H 64 M
227 134217728 8000000H 128 M
228 268435456 10000000H 256 M
229 536870912 20000000H 512 M
230 1073741824 40000000H 1 G