Name: Class: Date:
1
1. System software is used for tasks such as word processing, calculations and playing games.
a. True
b. False
ANSWER: False
2. If an object’s methods are well written, the user is unaware of the low-level details of how the methods are executed,
and the user must simply understand the interface or interaction between the method and the object.
a. True
b. False
ANSWER: True
3. A Java identifier can contain only letters, digits, ampersands, or number signs.
a. True
b. False
ANSWER: False
4. You must use the Java interpreter to translate the bytecode into executable statements before running a Java application.
a. True
b. False
ANSWER: True
5. When you issue the command to compile a class containing errors, the Java compiler does not produce any error
messages. You will first need to run the class in order to see error messages.
a. True
b. False
ANSWER: False
6. Logic errors are easily identified when a program is compiled.
a. True
b. False
ANSWER: False
7. Although not a requirement, it is Java standard that class identifiers begin with an uppercase letter and use other
uppercase letters to improve readability.
a. True
b. False
ANSWER: True
8. A compiler ignores whitespace (that is, any combination of nonprinting characters) between words and lines.
a. True
b. False
ANSWER: True
9. Dots (or periods) in a Java statement are used to separate the names of the components that make up the statement.
a. True
Copyright Cengage Learning. Powered by Cognero. Page 1
,Name: Class: Date:
1
b. False
ANSWER: True
10. Using the void keyword in the main() method header indicates that a value will be returned by the main()
method is called.
a. True
b. False
ANSWER: False
11. A program written in ____ is the most basic circuitry-level language.
a. Java b. machine language
c. BASIC d. C
ANSWER: b
12. Locating and repairing all syntax errors is part of the process of ____ a program.
a. interpreting b. compiling
c. debugging d. executing
ANSWER: c
13. ____ are also called modules, methods, functions, and subroutines. Java programmers most frequently use the term
“method.”
a. Procedures b. Calls
c. Classes d. Applications
ANSWER: a
14. ____ refers to the hiding of data and methods within an object.
a. Instance b. Inheritance
c. Passed d. Encapsulation
ANSWER: d
15. ____ describes the feature of languages that allows the same word to be interpreted correctly in different situations
based on the context.
a. Polymorphism b. Architecturally neutral
c. Source code d. Insulation
ANSWER: a
16. Given the statement: System.out.println(“First Java application”);
out refers to ____.
a. the screen b. the standard output device
c. the printer d. the keyboard
ANSWER: b
17. ____ are pieces of information that are sent into, or passed to, a method, usually because the method requires the
information to perform its task or carry out its purpose.
a. Applets b. Methods
Copyright Cengage Learning. Powered by Cognero. Page 2
,Name: Class: Date:
1
c. Arguments d. Objects
ANSWER: c
18. A(n) ____ defines the circumstances under which a class can be accessed and the other classes that have the right to
use a class.
a. identifier b. access specifier
c. parameter d. Pascal casing
ANSWER: b
19. In Java, the reserved keyword ____ means that a method is accessible and usable even though no objects of the class
exist.
a. active b. undefined
c. static d. void
ANSWER: c
20. Line comments start with ____.
a. a forward slash and an asterisk b. two forward slashes
c. a forward slash and two asterisks d. a percent sign
ANSWER: b
21. In a ____ environment, you can change directories using the cd command. For example, to change to a directory
named MyClasses, you type cd MyClasses and press Enter.
a. Windows b. Java
c. graphical d. DOS
ANSWER: d
22. After a successful compile, you can run the class file on any computer that has a ____.
a. Java language interpreter b. Web browser
c. text editor d. DOS
ANSWER: a
23. Java contains a class named ____ that allows you to produce dialog boxes.
a. JBox b. JOptionPane
c. JDialog d. JGUI
ANSWER: b
24. Whenever a method requires multiple arguments, the arguments are always separated with ____.
a. commas b. periods
c. forward slashes d. brackets
ANSWER: a
25. If a compiler detects a violation of language rules, it refuses to translate the class to ____.
a. an application b. a logic error
c. machine code d. Java
ANSWER: c
Copyright Cengage Learning. Powered by Cognero. Page 3
, Name: Class: Date:
1
26. ____ is the process the compiler uses to divide your source code into meaningful portions; the message means that the
compiler was in the process of analyzing the code when the end of the file was encountered prematurely.
a. Running b. Debugging
c. Compiling d. Parsing
ANSWER: d
27. A ____ is an error not detected until the program asks the computer to do something wrong, or even illegal, while
executing.
a. syntax error b. run-time error
c. package d. Java API
ANSWER: b
28. It is best to use the ____ available text editor when writing Java programs.
a. most complex b. simplest
c. best d. latest
ANSWER: b
29. It is a tradition among programmers that the first program you write in any language produces “____” as its output.
a. Hi, your name! b. Hello, world!
c. My first program! d. Hello, your name!
ANSWER: b
30. When you run a Java application using the ____ command, do not add the .class extension to the filename.
a. class b. static
c. java d. output
ANSWER: c
31. If you receive an error that states, “Exception in thread ‘main’ java.lang.NoClassDefFoundError,” when you try to
execute the application, you probably do not have your ____ set correctly.
a. class length b. class path
c. java d. object
ANSWER: b
32. {
public static void main(String[] args)
{
System.out.println(“First Java application”);
}
}
Given the above code, which item identifies the access specifier?
a. public b. static
c. void d. First
ANSWER: a
Copyright Cengage Learning. Powered by Cognero. Page 4
1
1. System software is used for tasks such as word processing, calculations and playing games.
a. True
b. False
ANSWER: False
2. If an object’s methods are well written, the user is unaware of the low-level details of how the methods are executed,
and the user must simply understand the interface or interaction between the method and the object.
a. True
b. False
ANSWER: True
3. A Java identifier can contain only letters, digits, ampersands, or number signs.
a. True
b. False
ANSWER: False
4. You must use the Java interpreter to translate the bytecode into executable statements before running a Java application.
a. True
b. False
ANSWER: True
5. When you issue the command to compile a class containing errors, the Java compiler does not produce any error
messages. You will first need to run the class in order to see error messages.
a. True
b. False
ANSWER: False
6. Logic errors are easily identified when a program is compiled.
a. True
b. False
ANSWER: False
7. Although not a requirement, it is Java standard that class identifiers begin with an uppercase letter and use other
uppercase letters to improve readability.
a. True
b. False
ANSWER: True
8. A compiler ignores whitespace (that is, any combination of nonprinting characters) between words and lines.
a. True
b. False
ANSWER: True
9. Dots (or periods) in a Java statement are used to separate the names of the components that make up the statement.
a. True
Copyright Cengage Learning. Powered by Cognero. Page 1
,Name: Class: Date:
1
b. False
ANSWER: True
10. Using the void keyword in the main() method header indicates that a value will be returned by the main()
method is called.
a. True
b. False
ANSWER: False
11. A program written in ____ is the most basic circuitry-level language.
a. Java b. machine language
c. BASIC d. C
ANSWER: b
12. Locating and repairing all syntax errors is part of the process of ____ a program.
a. interpreting b. compiling
c. debugging d. executing
ANSWER: c
13. ____ are also called modules, methods, functions, and subroutines. Java programmers most frequently use the term
“method.”
a. Procedures b. Calls
c. Classes d. Applications
ANSWER: a
14. ____ refers to the hiding of data and methods within an object.
a. Instance b. Inheritance
c. Passed d. Encapsulation
ANSWER: d
15. ____ describes the feature of languages that allows the same word to be interpreted correctly in different situations
based on the context.
a. Polymorphism b. Architecturally neutral
c. Source code d. Insulation
ANSWER: a
16. Given the statement: System.out.println(“First Java application”);
out refers to ____.
a. the screen b. the standard output device
c. the printer d. the keyboard
ANSWER: b
17. ____ are pieces of information that are sent into, or passed to, a method, usually because the method requires the
information to perform its task or carry out its purpose.
a. Applets b. Methods
Copyright Cengage Learning. Powered by Cognero. Page 2
,Name: Class: Date:
1
c. Arguments d. Objects
ANSWER: c
18. A(n) ____ defines the circumstances under which a class can be accessed and the other classes that have the right to
use a class.
a. identifier b. access specifier
c. parameter d. Pascal casing
ANSWER: b
19. In Java, the reserved keyword ____ means that a method is accessible and usable even though no objects of the class
exist.
a. active b. undefined
c. static d. void
ANSWER: c
20. Line comments start with ____.
a. a forward slash and an asterisk b. two forward slashes
c. a forward slash and two asterisks d. a percent sign
ANSWER: b
21. In a ____ environment, you can change directories using the cd command. For example, to change to a directory
named MyClasses, you type cd MyClasses and press Enter.
a. Windows b. Java
c. graphical d. DOS
ANSWER: d
22. After a successful compile, you can run the class file on any computer that has a ____.
a. Java language interpreter b. Web browser
c. text editor d. DOS
ANSWER: a
23. Java contains a class named ____ that allows you to produce dialog boxes.
a. JBox b. JOptionPane
c. JDialog d. JGUI
ANSWER: b
24. Whenever a method requires multiple arguments, the arguments are always separated with ____.
a. commas b. periods
c. forward slashes d. brackets
ANSWER: a
25. If a compiler detects a violation of language rules, it refuses to translate the class to ____.
a. an application b. a logic error
c. machine code d. Java
ANSWER: c
Copyright Cengage Learning. Powered by Cognero. Page 3
, Name: Class: Date:
1
26. ____ is the process the compiler uses to divide your source code into meaningful portions; the message means that the
compiler was in the process of analyzing the code when the end of the file was encountered prematurely.
a. Running b. Debugging
c. Compiling d. Parsing
ANSWER: d
27. A ____ is an error not detected until the program asks the computer to do something wrong, or even illegal, while
executing.
a. syntax error b. run-time error
c. package d. Java API
ANSWER: b
28. It is best to use the ____ available text editor when writing Java programs.
a. most complex b. simplest
c. best d. latest
ANSWER: b
29. It is a tradition among programmers that the first program you write in any language produces “____” as its output.
a. Hi, your name! b. Hello, world!
c. My first program! d. Hello, your name!
ANSWER: b
30. When you run a Java application using the ____ command, do not add the .class extension to the filename.
a. class b. static
c. java d. output
ANSWER: c
31. If you receive an error that states, “Exception in thread ‘main’ java.lang.NoClassDefFoundError,” when you try to
execute the application, you probably do not have your ____ set correctly.
a. class length b. class path
c. java d. object
ANSWER: b
32. {
public static void main(String[] args)
{
System.out.println(“First Java application”);
}
}
Given the above code, which item identifies the access specifier?
a. public b. static
c. void d. First
ANSWER: a
Copyright Cengage Learning. Powered by Cognero. Page 4