Вы находитесь на странице: 1из 5

16/17 FJ Ch2 Test

True/False
Indicate whether the sentence or statement is true or false.

____ 1. Java is the fastest growing programming language in the world.


____ 2. Java programs cannot be run on different types of computers unless code changes are made.
____ 3. Compared to C++, Java is more difficult to use and learn, more error prone, and less portable.
____ 4. A JVM is a program that behaves like a computer.
____ 5. Any computer can run an interpreter.
____ 6. Java applets are inherently insecure.
____ 7. Terminal-oriented programs are similar in structure to programs that process files of sequentially organized
data.
____ 8. Sending messages to objects always takes the form <name of object>(<parameters>).
____ 9. Java programs cannot be written using a simple text editor, such as Notepad.
____ 10. When a syntax error is found by the Java compiler, the error message that is provided yields no information
about the type of error that occurred or where it occurred.
____ 11. The main factor affecting a programs readability is its layout.
____ 12. During the course of a program, a variables value cannot change.
____ 13. It is required that variable names begin with a lowercase letter.
____ 14. There is a limit to the number of variables that you can declare in a program.

Multiple Choice
Identify the letter of the choice that best completes the statement or answers the question.

____ 15. Java is a modern ____ programming language.


a. first-generation c. procedural
b. object-oriented d. second-generation
____ 16. Java bears a superficial resemblance to ____, which is currently the worlds most popular industrial-strength
programming language.
a. C c. COBOL
b. BASIC d. C++
____ 17. The Java compiler translates Java into ____.
a. natural language c. byte code
b. machine language d. bit code
____ 18. A(n) ____ user interface uses the Java console and the command prompt to display data, prompt the user for
data, and read data into a program.
a. terminal I/O c. graphical
b. text d. illustrative
____ 19. ____ is the name of an object that knows how to display or print characters in a terminal window.
a. System c. System.out
b. System.terminal d. Out.System
____ 20. The end of a statement in a Java program is denoted by a ____.
a. : c. ;
b. . d. }
____ 21. Which of the following Java statements would print the text Hello in a terminal window?
a. System.println(Hello); c. System.printLine(Hello);
b. System.out.println(Hello); d. System.out.println(Hello);
____ 22. The file extension for a Java source code file must be ____.
a. .java c. .jav
b. .j d. .sun
____ 23. The file extension for a byte code file is always ____.
a. .cla c. .java
b. .class d. .jav
____ 24. Using a simple text editor in Windows to write Java programs, plus running the Java compiler and the JVM
from the command line in Windows is known as the ____ development environment.
a. simple c. integrated
b. DOS d. Windows
____ 25. A(n) ____ statement, found at the beginning of a Java source code file, tells the compiler where to find
complete specifications for a class that will be used in the Java source code.
a. include c. use
b. export d. import
____ 26. In general, instantiation takes the form ____.
a. SomeClass someObject = new SomeClass(some parameters);
b. SomeClass someObject = SomeClass(some parameters);
c. someObject = new SomeClass(some parameters);
d. SomeClass = new SomeClass(some parameters);
____ 27. The assignment operator is represented in Java by the symbol ____.
a. > c. ==
b. = d. !=
____ 28. The multiplication operator is represented in Java by the symbol ____.
a. x c. *
b. / d. %

Matching

a. Integrated development environment g. (AC) Source Code


(IDE)
b. Just-in-time compilation (JIT) h. (AD) Byte Code
c. DOS development environment i. (AE) Parameter
d. Variable j. (BC) Statement
e. Assignment Operator k. (BD) Hacking
f. (AB) Java virtual machine (JVM) l. BE) Terminal I/O user interface

____ 29. The program text as viewed by the human who creates or reads it, prior to compilation.
____ 30. A set of software tools that allow you to edit, compile, run and debug programs with in one user interface.
____ 31. The symbol =, which is used to store a value in a variable.
____ 32. A feature of some Java virtual machines that first translate byte codes to machines code before executing
them.
____ 33. A program that interprets Java byte code and executes them.
____ 34. The kind of object code generated by a Java compiler and interpreted by a Java virtual machine.
____ 35. A set of software tools that allow you to edit, compile, run and debug programs using the DOS operating
system.
____ 36. A value or expression passed in a method call.
____ 37. A user interface that allows the user to enter input from the keyboard and view output as text in a window.
____ 38. The use of clever techniques to write a program, often for the purpose of gaining access to protected resources
on networks.
____ 39. A memory location, referenced by an identifier, whose value can be changed during execution of a program.
____ 40. An individual instruction in a program.
16/17 FJ Ch2 Test
Answer Section

TRUE/FALSE

1. ANS: T REF: 31
2. ANS: F REF: 32
3. ANS: F REF: 32
4. ANS: T REF: 32
5. ANS: T REF: 33
6. ANS: F REF: 33
7. ANS: T REF: 34
8. ANS: T REF: 35
9. ANS: F REF: 38
10. ANS: F REF: 40
11. ANS: T REF: 41
12. ANS: F REF: 43
13. ANS: F REF: 43
14. ANS: F REF: 43

MULTIPLE CHOICE

15. ANS: B REF: 32


16. ANS: D REF: 32
17. ANS: C REF: 32
18. ANS: A REF: 33
19. ANS: C REF: 35
20. ANS: C REF: 35
21. ANS: D REF: 35
22. ANS: A REF: 37
23. ANS: B REF: 37
24. ANS: B REF: 38
25. ANS: D REF: 43
26. ANS: A REF: 43
27. ANS: B REF: 44
28. ANS: C REF: 44

MATCHING

29. ANS: G
30. ANS: A
31. ANS: E
32. ANS: B
33. ANS: F
34. ANS: H
35. ANS: C
36. ANS: I
37. ANS: L
38. ANS: K
39. ANS: D
40. ANS: J

Вам также может понравиться