TRU COMP 1131
Computer Programming I
Final Exam Sample Questions and Answers | 2026–2027
Independent study resource • 42 original questions • Java
Suggested duration: 3 hours | Total marks: 100
This practice examination is not an official Thompson Rivers University examination. The format, marks and
duration are suggested for practice.
Course topic coverage
Module Topic Practice marks
1 Introduction to Java 10
2 Data and expressions 15
3 Using classes and objects 10
4 Conditionals and loops 20
5 Writing classes and methods 20
6 Arrays 15
7 Recursion 10
Total 100
COMP 1131 | Independent practice examination 1
, A. Multiple-choice questions (20 marks)
One mark per question.
1. Which component executes Java bytecode?
A. Java compiler
B. Java Virtual Machine
C. Text editor
D. Operating system compiler
Answer: B. JVM executes compiled bytecode.
2. Which is a valid Java identifier?
A. 2number
B. class
C. studentAge
D. student-age
Answer: C. studentAge.
3. What is in Java?
A. 3.4
B. 4
C. 3
D. 2
Answer: C. Integer division discards the fraction.
4. What is 17 % 5?
A. 3
B. 2
C. 5
D. 0
Answer: B. The remainder is 2.
5. Which type stores true or false?
A. int
B. char
C. boolean
D. double
Answer: C. boolean.
6. Which keyword creates an object?
A. create
B. class
C. object
D. new
Answer: D. new.
COMP 1131 | Independent practice examination 2
Computer Programming I
Final Exam Sample Questions and Answers | 2026–2027
Independent study resource • 42 original questions • Java
Suggested duration: 3 hours | Total marks: 100
This practice examination is not an official Thompson Rivers University examination. The format, marks and
duration are suggested for practice.
Course topic coverage
Module Topic Practice marks
1 Introduction to Java 10
2 Data and expressions 15
3 Using classes and objects 10
4 Conditionals and loops 20
5 Writing classes and methods 20
6 Arrays 15
7 Recursion 10
Total 100
COMP 1131 | Independent practice examination 1
, A. Multiple-choice questions (20 marks)
One mark per question.
1. Which component executes Java bytecode?
A. Java compiler
B. Java Virtual Machine
C. Text editor
D. Operating system compiler
Answer: B. JVM executes compiled bytecode.
2. Which is a valid Java identifier?
A. 2number
B. class
C. studentAge
D. student-age
Answer: C. studentAge.
3. What is in Java?
A. 3.4
B. 4
C. 3
D. 2
Answer: C. Integer division discards the fraction.
4. What is 17 % 5?
A. 3
B. 2
C. 5
D. 0
Answer: B. The remainder is 2.
5. Which type stores true or false?
A. int
B. char
C. boolean
D. double
Answer: C. boolean.
6. Which keyword creates an object?
A. create
B. class
C. object
D. new
Answer: D. new.
COMP 1131 | Independent practice examination 2