Instructor’s Manual
for
Harvey M. Deitel
Paul J. Deitel
, Java How to Program,
5/e: Instructor’s Manual
Contents
1 Introduction to Computers, the Internet and the Web 1
2 Introduction to Java Applications 6
3 Introduction to Java Applets 36
4 Control Statements: Part 1 59
5 Control Structures: Part 2 94
6 Methods 131
7 Arrays 206
8 Object-Based Programming 331
9 Object-Oriented Programming 404
10 Object-Oriented Programming: Polymorphism 429
11 Strings and Characters 457
12 Graphics and Java2D 531
13 Graphical User Interface Components: Part 1 582
Java How to Program, 5/e: Instructor’s Manual Contents II
,14 Graphical User Interface Components: Part 2 661
15 Exception Handling 708
16 Multithreading 717
17 Files and Streams 745
18 Networking 792
19 Multimedia: Images, Animation, Audio and Video 843
20 Data Structures 859
21 Java Utilities Package and Bit Manipulation 936
22 Collections 957
23 Java Database Connectivity (JDBC) 978
24 Servlets 1043
25 JavaServer Pages (JSP) 1067
C Number Systems 1099
G Unicode 1103
SELF-REVIEW EXERCISES
1.1 Fill in the blanks in each of the following statements:
a) The company that popularized personal computing was .
ANS: Apple
b) The computer that made personal computing legitimate in business and industry was the
.
ANS: IBM Personal Computer
c) Computers process data under the control of sets of instructions called .
ANS: programs
d) The six key logical units of the computer are the , , ,
, and .
ANS: input unit, output unit, memory unit, arithmetic and logic unit, central processing unit,
secondary storage unit.
e) The three classes of languages discussed in the chapter are , and
.
ANS: machine languages, assembly languages, high-level languages.
f) The programs that translate high-level language programs into machine language are
called .
, 2 Introduction to Computers, the Internet and the Web Chapter 1
ANS: compilers
g) The allows computer users to locate and view multimedia-based documents
on almost any subject over the Internet.
ANS: World Wide Web
h) Java typically are stored on your computer and are designed to execute in-
dependent of World Wide Web browsers.
ANS: applications
i) allows an applet or application to perform multiple activities in parallel.
ANS: Multithreading
1.2 Fill in the blanks in each of the following sentences about the Java environment:
a) The command from the Java 2 Software Development Kit executes an ap-
plet.
ANS: appletviewer
b) The command from the Java 2 Software Development Kit executes an ap-
plication
ANS: java
c) The command from the Java 2 Software Development Kit compiles a Java
program.
ANS: javac
d) A(n) file is required to invoke a Java applet.
ANS: HTML
e) A Java program file must end with the file extension.
ANS: .java
f) When a Java program is compiled, the file produced by the compiler ends with the
file extension.
ANS: .class
g) The file produced by the Java compiler contains that are interpreted to exe-
cute a Java applet or application.
ANS: bytecodes
1.3 Fill in the blanks in each of the following statements (based on Sections 1.15 and 1.16):
a) Over the past decade, the software-engineering industry has made significant progress in
the field of —proven architectures for constructing flexible and maintainable
object-oriented software.
ANS: design patterns
b) Objects have the property of —although objects may know hot to communi-
cate with one another across well-defined interfaces, objects normally are not allowed to
know how other objects are implemented.
ANS: information hiding
c) Java programmers concentrate on creating their own user-defined types, called
.
ANS: classes
d) Classes can also have relationships with other classes. These relationships are called
.
ANS: associations
e) The process of analyzing and designing a system from an object-oriented point of view
is called .
ANS: object-oriented analysis and design (OOAD)
EXERCISES
© Copyright 1992–2003 by Deitel & Associates, Inc. and Prentice Hall. All Rights Reserved.
for
Harvey M. Deitel
Paul J. Deitel
, Java How to Program,
5/e: Instructor’s Manual
Contents
1 Introduction to Computers, the Internet and the Web 1
2 Introduction to Java Applications 6
3 Introduction to Java Applets 36
4 Control Statements: Part 1 59
5 Control Structures: Part 2 94
6 Methods 131
7 Arrays 206
8 Object-Based Programming 331
9 Object-Oriented Programming 404
10 Object-Oriented Programming: Polymorphism 429
11 Strings and Characters 457
12 Graphics and Java2D 531
13 Graphical User Interface Components: Part 1 582
Java How to Program, 5/e: Instructor’s Manual Contents II
,14 Graphical User Interface Components: Part 2 661
15 Exception Handling 708
16 Multithreading 717
17 Files and Streams 745
18 Networking 792
19 Multimedia: Images, Animation, Audio and Video 843
20 Data Structures 859
21 Java Utilities Package and Bit Manipulation 936
22 Collections 957
23 Java Database Connectivity (JDBC) 978
24 Servlets 1043
25 JavaServer Pages (JSP) 1067
C Number Systems 1099
G Unicode 1103
SELF-REVIEW EXERCISES
1.1 Fill in the blanks in each of the following statements:
a) The company that popularized personal computing was .
ANS: Apple
b) The computer that made personal computing legitimate in business and industry was the
.
ANS: IBM Personal Computer
c) Computers process data under the control of sets of instructions called .
ANS: programs
d) The six key logical units of the computer are the , , ,
, and .
ANS: input unit, output unit, memory unit, arithmetic and logic unit, central processing unit,
secondary storage unit.
e) The three classes of languages discussed in the chapter are , and
.
ANS: machine languages, assembly languages, high-level languages.
f) The programs that translate high-level language programs into machine language are
called .
, 2 Introduction to Computers, the Internet and the Web Chapter 1
ANS: compilers
g) The allows computer users to locate and view multimedia-based documents
on almost any subject over the Internet.
ANS: World Wide Web
h) Java typically are stored on your computer and are designed to execute in-
dependent of World Wide Web browsers.
ANS: applications
i) allows an applet or application to perform multiple activities in parallel.
ANS: Multithreading
1.2 Fill in the blanks in each of the following sentences about the Java environment:
a) The command from the Java 2 Software Development Kit executes an ap-
plet.
ANS: appletviewer
b) The command from the Java 2 Software Development Kit executes an ap-
plication
ANS: java
c) The command from the Java 2 Software Development Kit compiles a Java
program.
ANS: javac
d) A(n) file is required to invoke a Java applet.
ANS: HTML
e) A Java program file must end with the file extension.
ANS: .java
f) When a Java program is compiled, the file produced by the compiler ends with the
file extension.
ANS: .class
g) The file produced by the Java compiler contains that are interpreted to exe-
cute a Java applet or application.
ANS: bytecodes
1.3 Fill in the blanks in each of the following statements (based on Sections 1.15 and 1.16):
a) Over the past decade, the software-engineering industry has made significant progress in
the field of —proven architectures for constructing flexible and maintainable
object-oriented software.
ANS: design patterns
b) Objects have the property of —although objects may know hot to communi-
cate with one another across well-defined interfaces, objects normally are not allowed to
know how other objects are implemented.
ANS: information hiding
c) Java programmers concentrate on creating their own user-defined types, called
.
ANS: classes
d) Classes can also have relationships with other classes. These relationships are called
.
ANS: associations
e) The process of analyzing and designing a system from an object-oriented point of view
is called .
ANS: object-oriented analysis and design (OOAD)
EXERCISES
© Copyright 1992–2003 by Deitel & Associates, Inc. and Prentice Hall. All Rights Reserved.