(Gaddis)
Chapter 1: Introduction to Computers and Java
CHAPTER 1: INTRODUCTION TO COMPUTERS AND JAVA
TRUE / FALSE
1. Logical errors are mistakes that cause the program to produce erroneous results.
ANS: T
2. The Java Virtual Machine is a program that reads Java byte code instructions and executes
them as they are read.
ANS: T
3. Colons are used to indicate the end of a Java statement.
ANS: F
4. Compiled byte code is also called source code.
ANS: F
5. Application software refers to programs that make the computer useful to the user.
ANS: T
6. Each byte is assigned a unique number known as an address.
ANS: T
,Starting Out with Java: From Control Structures through Objects 8e
(Gaddis)
Chapter 1: Introduction to Computers and Java
7. Encapsulation refers to the combining of data and code into a single object.
ANS: T
8. Java source files end with the .class extension.
ANS: F
9. A procedure is a set of programming language statements that, together, perform a specific
task.
ANS: T
10. A solid-state drive has no moving parts and operates faster than a traditional disk drive.
ANS: T
11. The computer is a tool used by so many professionals that it cannot be easily
categorized.
ANS: T
12. The CPU is the part of the computer that actually runs programs.
ANS: T
13. Main memory is volatile, meaning its contents are lost when the computer is turned off.
ANS: T
14. Secondary storage is non-volatile, meaning it retains data when the computer is turned
off.
ANS: T
,Starting Out with Java: From Control Structures through Objects 8e
(Gaddis)
Chapter 1: Introduction to Computers and Java
15. A compiler translates source code into machine language.
ANS: T
16. An interpreter translates and executes source code one line at a time.
ANS: T
17. Syntax errors are usually easier to find and correct than logical errors.
ANS: T
18. A runtime error is an error that occurs while the program is running.
ANS: T
19. Java was developed by Sun Microsystems (now Oracle).
ANS: T
20. Java is an object-oriented programming language.
ANS: T
21. The main method is the entry point of a Java application.
ANS: T
22. The println method is used to print a line of text to the console.
ANS: T
, Starting Out with Java: From Control Structures through Objects 8e
(Gaddis)
Chapter 1: Introduction to Computers and Java
23. In Java, the // symbols are used for multi-line comments.
ANS: F
24. Variables are named storage locations in the computer's memory.
ANS: T
25. You must declare a variable before you can use it in Java.
ANS: T
26. The int data type is used to store floating-point numbers.
ANS: F
27. The double data type is used to store real numbers with fractional parts.
ANS: T
28. The char data type is used to store a single character.
ANS: T
29. The boolean data type can hold only two values: true or false.
ANS: T
30. Java is a case-sensitive language.
ANS: T