1. The most basic circuitry-level computer language is ____________.
a. machine language
b. Java
c. high-level language
d. C++
Answer: a. machine language
Explanation: Machine language is the lowest-level programming language, written in binary (0s and 1s), that
the CPU can execute directly.
2. Languages that let you use an easily understood vocabulary of descriptive terms are
____________ languages.
a. procedural
b. high-level
c. machine
d. object-oriented
Answer: b. high-level
Explanation: High-level languages like Java or Python use human-readable words such as 'print', 'if', 'else',
etc., making them easier to learn and use.
3. The rules of a programming language constitute its ____________.
a. syntax
b. logic
c. format
d. objects
Answer: a. syntax
Explanation: Syntax defines the rules and structure that a language uses to write valid code.
4. A ____________ translates high-level language statements into machine code.
a. programmer
b. syntax detector
c. compiler
d. decipherer
Answer: c. compiler
Explanation: A compiler translates code written in a high-level language (like Java) into machine code or
bytecode for execution.
5. Named computer memory locations are called ____________.
a. compilers
b. variables
c. addresses
d. appellations
Answer: b. variables
Explanation: Variables are names given to memory locations to store data that can change during program
execution.
6. The individual operations used in a program are grouped into logical units called
____________.
a. procedures
b. variables
c. constants
d. logistics
Answer: a. procedures
Explanation: Procedures (or methods/functions) group multiple statements into reusable, logical blocks of
code.
7. Envisioning program components as real-world-like objects is ____________.
a. command-line operating systems
b. procedural programming
c. object-oriented programming
d. machine languages
Answer: c. object-oriented programming
Explanation: Object-Oriented Programming (OOP) models real-world entities using classes and objects.
8. The values of an object's attributes are known as its ____________.
a. state
b. orientation
c. methods
d. condition
Answer: a. state
Explanation: An object's state is defined by the values of its attributes (also known as fields or properties) at a
given time.
9. An instance of a class is a(n) ____________.
a. method
b. procedure
c. object
d. case
Answer: c. object
Explanation: A class is a blueprint, and when you create a real example from that blueprint, you get an object.
10. Java is architecturally ____________.
a. neutral
b. oriented
c. specific
d. abstract
Answer: a. neutral
Explanation: Java is 'architecturally neutral' because compiled Java code (bytecode) can run on any platform
with a Java Virtual Machine (JVM).
11. You must compile classes written in Java into ____________.
a. bytecode
b. source code
c. javadoc statements
d. object code
Answer: a. bytecode
Explanation: Java source files (.java) are compiled into bytecode (.class), which the JVM executes.
12. All Java programming statements must end with a ____________.
a. period
b. comma
c. closing parenthesis
d. semicolon
Answer: d. semicolon
Explanation: In Java, every statement ends with a semicolon (;).
13. Arguments to methods always appear within ____________.
a. parentheses
b. double quotation marks
c. single quotation marks
d. curly braces
Answer: a. parentheses
Explanation: Method arguments are always enclosed in parentheses: methodName(argument1, argument2);
14. In a Java program, you must use ____________ to separate classes, objects, and
methods.
a. commas
b. semicolons
c. dots
d. forward slashes
Answer: c. dots
Explanation: Java uses the dot operator (.) to access members of classes/objects: object.method() or
Class.staticMethod().
15. All Java applications must have a method named ____________.
a. method()
b. main()
c. java()
d. Hello()
Answer: b. main()
Explanation: The Java program's entry point is public static void main(String[] args).
16. Nonexecuting program statements that provide documentation are called ____________.
a. classes
b. notes
c. comments
d. commands
Answer: c. comments
Explanation: Comments in Java (//, /* */, or /** */) are ignored by the compiler and used for documentation or
explanation.
17. Java supports three types of comments: ____________, ____________, and javadoc.
a. line, block
b. string, literal
c. constant, variable
d. single, multiple
Answer: a. line, block
Explanation: Java supports line comments (//), block comments (/* */), and javadoc comments (/** */).
18. Which of the following is not necessary to do before you can run a Java program?
a. coding
b. compiling
c. debugging
d. saving
Answer: c. debugging
Explanation: While debugging is useful to fix errors, it's not mandatory. You must write (code), save, and
compile before running.
19. The command to execute a compiled Java application is ____________.
a. run
b. execute
c. javac
d. java
Answer: d. java
Explanation: javac compiles code. java ClassName runs the compiled bytecode.
20. You save text files containing Java source code using the file extension ____________.
a. .java
b. .class
c. .txt
d. .src
Answer: a. .java
Explanation: Java source files are saved with the .java extension. The compiler generates .class files.