Page 842 - Introduction to Programming with Java: A Problem Solving Approach
P. 842
808 Index Enter events, 657
enum reserved word, 752 Enum types, 120n Equality
assignment versus, 108
testing objects for, 252–57, 510–11 equals method
implementing, 253–57 programmer-defined, 511–13 purpose, 89–90, 117, 253 syntax and semantics, 510–11
Equals sign, 66, 108, 401 equalsIgnoreCase method, 90, 117,
256–57
Error messages. See also Exception
handling
analyzing, 576–80 compilation, 20
dialog box icon for, 670 information in, 89 non-static method, 350–51
Escape sequences
basic features, 83–85 Unicode, 460–61, 745, 746–47
Euler’s number, 159
Evaluating expressions, 75–78
Event handlers, 646, 681
Event-delegation model, 646
Event-driven programming, 646–47 Events, 646
Evolution, 479
Exception class getMessage method,
572–73 Exception handling
approaches for checked exceptions, 569–72
approaches for unchecked exceptions, 566–69
exception categories, 564–66
with generic catch blocks, 572–73 with multiple catch blocks, 573–76 overview, 556–57
postponing catch, 580–82
try and catch block advantages,
559–61
try and catch block overview, 557–59 try block details, 563–64 understanding error messages, 576–80
Exception objects, 557 Exceptions
categories of, 564–66
defined, 372, 556 Exclamation point, 118 exists method, 627 Exponential growth, 227, 228 Exponents, 437
Expressions
casting, 82
defined, 74
evaluating, 75–78, 449–52
extends clauses, 488, 752 F
F suffix, 71
FactorialButton program, 663–67, 671, 672 Factorials
finding with recursion, 784–86
using for loops for, 128–29, 130, 131 false reserved word, 752
FICA tax calculation, 540–44
File class, 626–28
File-chooser dialog boxes, 629–34 FileInputStream class, 604, 619 Filenames, invalid, 604–5 FileNotFoundException class, 576 FileNotFoundException errors,
604–5, 608–9
FileOutputStream class, 604, 618–19 FileReader constructor calls, 608–9 Files
binary input/output, 618–21 defined, 7, 602
displaying in GUI format, 629–34 File class, 626–28 HTMLGenerator example, 612–15 input/output approaches for, 602–4,
622–26
text versus binary, 615–18 text-based input, 608–11 text-based output, 604–8
FileSizes program, 627–28 FileSizesGUI program, 631–34 FileWriter constructor calls, 607–8 Filler components, 729
fillOval method, 184, 185
Filters, 225–26
final modifier
FlowLayout manager
embedded containers using, 713–14, 729 as JPanel default, 714
overview, 650, 696–98
Folders, 16–18 Fonts, 461, 634 for loops
creating delays with, 454–55
for-each loops versus, 421
headers, 457–59
index variables, 130, 131, 134, 216–17 nested with two-dimensional arrays, 397 overview, 127–31, 752
tic-tac-toe application, 712
when to use, 132–33
For-each loops, 417, 420–22 Foreground colors, 674
Formal pseudocode, 47, 257–58 Format specifiers, 173–74
Format strings, 173, 402
Formatting characters, 15–16 Formatting output, 172–76
Forward branching statements, 123 Fraction class, 274, 276 Fractional digits, 175 FractionDriver class, 273, 276 Free software, 323
Free Software Foundation, 323n Free space in memory, 252 FreeFries program, 115
Freezing random number sequences,
Apago PDF Enhancer
with methods and classes, 472, 489–90, 180–81
752
with named constants, 72, 270, 752 optional for interfaces, 535 prohibited with abstract methods,
533
Final states, in UML diagrams, 778 finally blocks, 582, 584, 752 FindHypotenuse program, 158, 159 findStudent method, 388, 389 Firing an event, 646
First-cut UML diagrams, 278
Fixed seeds, 180–81
Flags, 175–76
Flash drives, 6–7
FlightTimes class, 400–402 FlightTimesDriver class, 398, 399 float data type
default value, 209
as primitive type, 85, 752 when to use, 69–70, 436–37
Floating-point casts, 82–83 Floating-point constants, 71 Floating-point numbers
division of, 74–75, 82–83 initializing, 209
when to use, 69–70, 435–37
FloorSpace program, 127, 128
Floppy disks, 8
Flow of control, 30–31. See also Control
statements Flowcharts
defined, 26
with if statements, 34–35
to illustrate flow of control, 30–31
Frequency distributions, 385–86 FriendlyHello program, 92
FullTime class, 486–88
Functions, mathematical, 60–61, 155–56 FundRaiser program, 358–64
G
Gap arguments, 699, 704
Garage Door program, 276–84 GarageDoor program, 136–38 GarageDoorSystem class, 282–83 Garbage collection, 252
Garbage values, 80, 218, 247
Gemini project, 325
General-purpose swapping algorithm,
257–59
Generic catch blocks, 572–73 Generic classes, 411
Generic return types, 411
get methods
ArrayList, 411 Calendar class, 329–31 Color, 674
defined, 224–25 JButton, 663 JComboBox, 727 JLabel, 652 JTextArea, 719 JTextField, 653
getActionCommand method, 673–74 getBackground method, 674 getContentPane method, 676 getFICA method, 541 getForeground method, 674