Quiz Space

Java Quiz 1: 23 February 2025 (January 2025 term)

Question 1

+6 marksOne correct option

Consider the code given below. How many activation records are created while executing this code?

java
class ClassOne{
public void methodOne(){
// ...
}
public void methodTwo(){
// ...
methodOne();
// ...
}
public void methodThree(){
// ...
methodTwo();
// ...
}
}
class ClassTwo{
public static void main(String[] args){
// ...
ClassOne c = new ClassOne();
c.methodThree();
}
}
  1. A

    4

  2. B

    3

  3. C

    5

  4. D

    2

Question 2

+6 marksOne correct option
  1. A

    SeniorProgrammer is a valid subtype of Programmer because it has all methods of Programmer and additional functionality.

  2. B

    Programmer is not a valid subtype of SeniorProgrammer because it lacks the method reviewCode()

  3. C

    Subtyping allows SeniorProgrammer to be used wherever a Programmer is expected.

  4. D

    Subtyping allows Programmer to be used wherever a SeniorProgrammer is expected.

Question 3

+6 marksOne correct option

Consider the Java code given below.

java
public class NumberEvaluation {
public static void main(String[] args) {
int number = 10;
do {
number--;
} while (number > 5);
switch (number) {
case 5:
System.out.println("Low");
break;
case 6:
System.out.println("Medium");
break;
default:
if (number > 6) {
System.out.println("High");
} else {
System.out.println("Unknown");
}
break;
}
}
}

What will the output be?

  1. A

    Low

  2. B

    Medium

  3. C

    High

  4. D

    Unknown

12 more questions in this paper

Sign in with Google — it is free — to see every question with its answer and explanation, practise it in learning mode, or take it as a timed mock test.

More on the Java Quiz 1 23 Feb 2025 paper

The IIT Madras BS Programming Concepts using Java (Java) Quiz 1 paper sat on 23 Feb 2025, in the January 2025 term: 15 questions for 100 marks in 120 minutes. The first 3 questions are below. Sign in with Google — it is free — to see the whole paper with its answers and explanations, in learning mode or as a timed mock test.

FeatureJava Quiz 1 23 Feb 2025 at a glance
TermJanuary 2025 term
SubjectProgramming Concepts using Java
Course codeBSCS2005
Questions15
Marks100
Duration120 min
MCQ13
MSQ2
Official paperIIT M DIPLOMA AN EXAM QDD2 23 Feb 2025
Negative markingNo negative marking.
Updated

Same Quiz 1, other subjects

More Java