uiz Space

May 2026 term · Programming Concepts using Java · BSCS2005

Programming Concepts using Java Quiz 2: 16 August 2026, Set 2 (May 2026 term)

The IIT Madras BS Programming Concepts using Java (Java) Quiz 2 paper sat on 16 Aug 2026, in the May 2026 term, set 2: 15 questions for 50 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
15
Marks
50
Duration
120 min
MSQ
2
MCQ
13

Updated

Official paper: Programming Concepts Indian Institute Of Technology, Madras - Bs In Data Science And Applications Using Java 16 Jul 26 · No negative marking.

Question 1

+4 marksOne or more correct options

Which of the following statement(s) is/are true regarding activation records used during function calls?

Select all that apply.

  1. A

    An activation record is removed from the stack immediately after a local variable is declared.

  2. B

    Local variables of a function are typically stored inside its activation record.

  3. C

    A return address is stored in the activation record so that control can return to the caller after the execution of the called function.

  4. D

    All activation records in the stack correspond only to recursive function calls.

  5. E

    When a function calls another function, the control link in the callee's activation record points to the activation record of the caller.

Show answer

Correct answers

  • B

    Local variables of a function are typically stored inside its activation record.

  • C

    A return address is stored in the activation record so that control can return to the caller after the execution of the called function.

  • E

    When a function calls another function, the control link in the callee's activation record points to the activation record of the caller.

Question 2

+3 marksOne correct option

Consider the Java code given below.

Choose the correct option to fill in the so that the output is:

Consider the Java code given below.
Consider the Java code given below.
  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answer

  • A
    Figure from the original question paper

Question 3

+3 marksOne correct option

Consider the Java code given below.

Which of the following statements is FALSE?

Consider the Java code given below.
  1. A

    generates compilation error because the method cannot be overridden.

  2. B

    generates compilation error because variable cannot be accessed in class .

  3. C

    generates compilation error because a variable of type cannot refer to an object of type .

  4. D

    generates compilation error because a variable of type cannot refer to an object of type .

Show answer

Correct answer

  • D

    generates compilation error because a variable of type cannot refer to an object of type .

Question 4

+3 marksOne correct option

Consider the Java code given below.

Choose the correct option.

Consider the Java code given below.
  1. A

    generates compilation error because the class is not declared as abstract.

  2. B

    generates compilation error because of type cannot invoke method .

  3. C

    This code generates the output:

    This code generates the output:
  4. D

    This code generates the output:

    This code generates the output:
Show answer

Correct answer

  • B

    generates compilation error because of type cannot invoke method .

Question 5

+3 marksOne correct option

Consider the Java code given below.

Choose the correct option regarding the output produced by the code.

Consider the Java code given below.
  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answer

  • C
    Figure from the original question paper

Question 6

+3 marksOne correct option

What is the output of the following code?

What is the output of the following code?
  1. A

    12

  2. B

    18

  3. C

    9

  4. D

    15

Show answer

Correct answer

  • B

    18

Question 7

+3 marksOne correct option

Consider the Java program below.

Choose the correct option regarding the output of the code.

Consider the Java program below.
  1. A

    This code generates output:

    This code generates output:
  2. B

    This code generates output:

    This code generates output:
  3. C

    This code generates output:

    This code generates output:
  4. D

    This code generates a compile time error.

Show answer

Correct answer

  • D

    This code generates a compile time error.

Question 8

+3 marksOne correct option

Consider the following Java code.

Identify the correct option for the code given above.

Consider the following Java code.
  1. A

    This code generates output:

    This code generates output:
  2. B

    This code generates output:

    This code generates output:
  3. C

    This code generates a compile time error, since the implementations of from and are in conflict with each other.

  4. D

    This code generates a compile time error since is not implemented in class

Show answer

Correct answer

  • A

    This code generates output:

    This code generates output:

Question 9

+3 marksOne correct option

Consider the following Java code.

What will the output be?

Consider the following Java code.
  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answer

  • A
    Figure from the original question paper

Question 10

+3 marksOne correct option

Consider the Java code given below.

Choose the correct option.

Consider the Java code given below.
  1. A

    This program generates compiler error at Reason: An object of cannot be created inside method because it uses an object of in its constructor.

  2. B

    This program generates the output: followed by runtime error Reason: A method inside class is invoking method inside class , whereas is invoking another method in class .

    This program generates the output: followed by runtime error Reason: A method inside class  is invoking method  inside c
  3. C

    This program generates compiler error at Reason: A method inside class is invoking method inside class , whereas is invoking another method in class .

  4. D

    This program generates the output:

    This program generates the output:
Show answer

Correct answer

  • D

    This program generates the output:

    This program generates the output:

Question 11

+4 marksOne correct option

Consider the code given below.

Choose the correct option.

Consider the code given below.
  1. A

    generates compilation error because a variable of type cannot refer to an object of type .

  2. B

    This code generates the below output followed by runtime error at because there is ambiguity in which method is being invoked.

    This code generates the below output followed by runtime error at  because there is ambiguity in which  method is being
  3. C

    This code generates the output:

    This code generates the output:
  4. D

    This code generates the output:

    This code generates the output:
Show answer

Correct answer

  • D

    This code generates the output:

    This code generates the output:

Question 12

+4 marksOne correct option

Consider the code given below that checks whether two software modules are the same. Method is overridden to compare two objects as follows. If two modules have the same and , then they are considered the same.

Choose the correct option to fill in place of so that the output is:

Consider the code given below that checks whether two software modules are the same. Method  is overridden to compare tw
Consider the code given below that checks whether two software modules are the same. Method  is overridden to compare tw
  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answer

  • D
    Figure from the original question paper

Question 13

+4 marksOne correct option

Consider the code given below.

Identify the appropriate statement to fill in the blank at , such that the output is:

Consider the code given below.
Consider the code given below.
Consider the code given below.
  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answer

  • A
    Figure from the original question paper

Question 14

+4 marksOne correct option

Consider the Java code given below.

Identify the appropriate option to fill in the blank at line:1 such that output of the code will be:

Consider the Java code given below.
Consider the Java code given below.
  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answer

  • C
    Figure from the original question paper

Question 15

+3 marksOne or more correct options

Consider the Java program below.

Identify the correct option(s) to fill in the blank at , such that the output is:

Consider the Java program below.
Consider the Java program below.

Select all that apply.

  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answers

  • C
    Figure from the original question paper
  • D
    Figure from the original question paper