STUDY STACK · YEAR 1 · 2025 EDITION
LEVEL 2 · INTERMEDIATE
Intr odu ction
to Java
Pr ogr am m ing.
Intermediate Revision Paper · 100 Marks · 2h 30min
03 21 100 7
Sections Questions Total Marks Topics
TOPICS COVERED
Inheritance & Method Overriding · Abstract Classes & Interfaces · Exception Handling · 2D Arrays
· Static vs Instance Members · Polymorphism · Multi-class Program Design
Level 2 — What to expect
– Questions build on Level 1 concepts — make sure you have completed that paper first.
– You will be asked to write, trace, and debug multi-class Java programs.
– Some questions have no single correct answer — marks are given for reasoning and
structure.
– Model answers are at the end. Compare your approach, not just your output.
– One paper, one student. Do not share or redistribute this file.
studystack.gumroad.com
studystack.gumroad.com · For personal use only. Do not redistribute.
,JAVA PROGRAMMING · LEVEL 2 · CSE 102 / MT 103 · Intermediate Revision Paper
SECTION A
Multiple Choice · 20 marks — 2 marks each
Each question has one correct answer. Read carefully — some options are designed to mislead.
1 What is the output of the following code? [2 marks]
int x = 5;
int y = x++ + ++x;
System.out.println(y);
A. 10
B. 11
C. 12
D. 13
2 Which statement about constructors is TRUE? [2 marks]
A. A constructor must always have parameters
B. A constructor can have a return type of void
C. A class can have multiple constructors with different parameters
D. Constructors are inherited by subclasses
3 What is the output of this code? [2 marks]
String a = new String("hello");
String b = new String("hello");
System.out.println(a == b);
System.out.println(a.equals(b));
A. true / true
B. false / false
C. true / false
D. false / true
4 Which keyword prevents a method from being overridden in a subclass? [2 marks]
A. static
B. private
C. final
D. abstract
5 What does the following method return when called with mystery(4)? [2 marks]
public static int mystery(int n) {
if (n <= 1) return 1;
return n * mystery(n - 1);
}
A. 4
B. 8
studystack.gumroad.com · For personal use only. Do not redistribute.
, JAVA PROGRAMMING · LEVEL 2 · CSE 102 / MT 103 · Intermediate Revision Paper
C. 16
D. 24
6 A class is declared abstract. Which statement is TRUE? [2 marks]
A. It cannot have any methods with a body
B. It can be instantiated directly using new
C. It can have both abstract and non-abstract methods
D. It must implement all methods of any interface it uses
7 What is the output? [2 marks]
int[] arr = {10, 20, 30, 40, 50};
for (int i = arr.length - 1; i >= 0; i -= 2) {
System.out.print(arr[i] + " ");
}
A. 50 30 10
B. 10 30 50
C. 50 40 30
D. 40 20
8 Which of the following correctly defines polymorphism? [2 marks]
A. The ability of a class to inherit from multiple parent classes
B. The ability of one method name to behave differently based on the object calling it
C. Hiding the internal data of a class from outside access
D. Creating a new class based on an existing class
9 What happens when an exception is thrown but not caught in Java? [2 marks]
A. The program continues from the next line
B. The exception is silently ignored
C. The JVM prints a stack trace and the program terminates
D. The program restarts from the beginning
10 What is the value of result after this code runs? [2 marks]
int result = 0;
for (int i = 1; i <= 4; i++) {
if (i % 2 == 0) result += i;
}
A. 4
B. 6
C. 10
D. 2
studystack.gumroad.com · For personal use only. Do not redistribute.