Section A: Definitions & Concepts
1. A part of a program that can be evaluated to produce a value is called:
A. Statement
B. Expression
C. Algorithm
D. Syntax
2. A hardware device that stores data for processing is:
A. CPU
B. Memory
C. Compiler
D. Bytecode
3. A set of steps used to solve a computational problem is:
A. Syntax
B. Expression
C. Algorithm
D. Loop
4. A structure that selects one action from multiple possibilities:
A. Loop
B. Statement
C. Branching statement
D. Byte
5. A structure that repeats actions until a condition is met:
A. Branch
B. Loop
C. Expression
D. Compiler
Page 1 of 58 3/21/2026, 6:54:41 PM
, 6. A single binary digit (0 or 1) is called:
A. Byte
B. Bit
C. Code
D. Signal
7. The component that executes program instructions:
A. RAM
B. CPU
C. Disk
D. Compiler
8. A complete instruction in a program is a:
A. Statement
B. Expression
C. Syntax
D. Byte
9. The smallest addressable memory unit:
A. Bit
B. Byte
C. Word
D. Block
10. Java programs are compiled into:
A. Machine code
B. Bytecode
C. Assembly
D. Binary scripts
11. A program written in a high-level language is:
A. Object code
B. Source code
C. Bytecode
D. Machine code
Page 2 of 58 3/21/2026, 6:54:41 PM
, 12. The grammatical rules of a programming language are called:
A. Logic
B. Syntax
C. Semantics
D. Structure
Section B: True/False Concepts
13. Java is an object-oriented language.
A. True
B. False
14. Comments are ignored by the compiler.
A. True
B. False
15. A break statement cannot be used inside loops.
A. True
B. False
16. The + operator can concatenate strings.
A. True
B. False
17. flag1 && flag2 is true when one is false.
A. True
B. False
18. NetBeans is an IDE.
A. True
B. False
19. If an if-condition is true, the else block executes.
A. True
B. False
Page 3 of 58 3/21/2026, 6:54:41 PM
, 20. A do-while loop runs at least once.
A. True
B. False
Section C: Java Basics
21. Java was originally designed for:
A. Web development
B. Mobile apps
C. Home appliances
D. Databases
22. Which keyword is NOT required for constants?
A. final
B. static
C. void
D. int
23. Correct way to compare strings:
A. s1 == s2
B. s1.equals(s2)
C. compare(s1,s2)
D. s1.compareTo(s2)==true
24. Off-by-one error refers to:
A. Syntax mistake
B. Memory overflow
C. Loop running too many/few times
D. Compiler failure
25. Which prints formatted output?
A. System.out.print
B. System.out.println
C. System.out.printf
D. print.format
Page 4 of 58 3/21/2026, 6:54:41 PM