uiz Space

January 2026 term · Programming Concepts using Java · BSCS2005

Programming Concepts using Java Quiz 1: 15 March 2026 (January 2026 term)

The IIT Madras BS Programming Concepts using Java (Java) Quiz 1 paper sat on 15 Mar 2026, in the January 2026 term: 15 questions for 100 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
100
Duration
120 min
MCQ
14
MSQ
1

Updated

Official paper: Programming Concepts Using Java 15 Mar 26 · No negative marking.

Question 1

+6 marksOne correct option

Consider the following Java program.

What is the maximum number of activation records on the stack during the execution of the program?

Consider the following Java program.
  1. A

    2

  2. B

    3

  3. C

    4

  4. D

    5

Show answer

Correct answer

  • D

    5

Question 2

+6 marksOne correct option

Consider the Java code given below.

Choose the correct option regarding the given code.

Consider the Java code given 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 compilation error because the method cannot be overridden

Show answer

Correct answer

  • D

    This code generates a compilation error because the method cannot be overridden

Question 3

+6 marksOne correct option

Consider the Java code given below.

Choose the correct option.

Consider the Java code given below.
  1. A

    The program generates output:

    The program generates output:
  2. B

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

  3. C

    generates run time error because there is ambiguity in which method is being invoked.

  4. D

    The program generates output:

    The program generates output:
Show answer

Correct answer

  • D

    The program generates output:

    The program generates output:

Question 4

+6 marksOne correct option

Consider the Java code given below.

Choose the correct option to fill in place of and 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

  • B
    Figure from the original question paper

Question 5

+6 marksOne correct option

Consider the Java code given below.

What will the output be?

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

  • B
    Figure from the original question paper

Question 6

+6 marksOne correct option

Consider the Java code given below.

Identify the appropriate statements to fill in place of in order to correctly invoke method inside the while loop.

Consider the Java code given below.
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    Method cannot be invoked from an outside class.

Show answer

Correct answer

  • B

    —

Question 7

+7 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 interface reference cannot be passed as a constructor argument.

  2. B

    This program generates the output:

    This program generates the output:
  3. C

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

    This program generates the output: followed by runtime error Reason: A method inside  is invoking  inside  , whereas  is
  4. D

    This program generates compiler error at Reason: A method inside is invoking a method defined in an interface.

Show answer

Correct answer

  • B

    This program generates the output:

    This program generates the output:

Question 8

+7 marksOne correct option

Consider the Java code given below.

Choose the correct option.

Consider the Java code given below.
  1. A

    Compilation error at because private variable cannot be accessed without using an accessor method.

  2. B

    The program generates the output:

    The program generates the output:
  3. C

    The program generates the output:

    The program generates the output:
  4. D

    The program generates the output:

    The program generates the output:
Show answer

Correct answer

  • A

    Compilation error at because private variable cannot be accessed without using an accessor method.

Question 9

+7 marksOne correct option

Consider the following Java code.

Identify the lines which have errors.

Consider the following Java code.
  1. A

    Line 7 and Line 11

  2. B

    Line 4 and Line 5

  3. C

    Line 15 and Line 20

  4. D

    Line 1 and Line 2

Show answer

Correct answer

  • C

    Line 15 and Line 20

Question 10

+7 marksOne correct option

Consider the Java code given below.

Identify the correct option to fill in place of , such 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

  • B
    Figure from the original question paper

Question 11

+7 marksOne correct option

Consider the Java code given below.

Choose the correct option.

Consider the Java code given below.
  1. A

    This code generates the output:

    This code generates the output:
  2. B

    This code generates the output:

    This code generates the output:
  3. C

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

  4. D

    generates runtime error because there is ambiguity in which method is being invoked.

Show answer

Correct answer

  • A

    This code generates the output:

    This code generates the output:

Question 12

+7 marksOne correct option

Consider the Java code given below.

What will the output be?

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 13

+7 marksOne correct option

Consider the code given below.

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

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

  • B
    Figure from the original question paper

Question 14

+7 marksOne correct option

Consider the Java code given below.

Choose the correct option regarding the above code.

Consider the Java code given below.
  1. A

    generates compilation error because the method is not abstract.

  2. B

    generates compilation error because class cannot implement two interfaces.

  3. C

    generates compilation error because class is not declared as abstract.

  4. D

    , and generate compilation errors because the methods , and are not abstract.

Show answer

Correct answer

  • C

    generates compilation error because class is not declared as abstract.

Question 15

+8 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

    —

  2. B

    —

  3. C
    Figure from the original question paper
  4. D

    —

Show answer

Correct answers

  • C
    Figure from the original question paper
  • D

    —