uiz Space

January 2026 term · Programming Concepts using Java · BSCS2005

Programming Concepts using Java End Term: 10 May 2026 (January 2026 term)

The IIT Madras BS Programming Concepts using Java (Java) End Term paper sat on 10 May 2026, in the January 2026 term: 23 questions for 100 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
23
Marks
100
Duration
180 min
MCQ
21
MSQ
2

Updated

Official paper: Programming Concepts Using Java 06 May 26 · No negative marking.

Question 1

+4 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 2

+4 marksOne correct option

Consider the Java code given below.

What will the output be?

Consider the Java code given below.
  1. A

    This program generates the output:

    This program generates the output:
  2. B

    This program generates the output:

    This program generates the output:
  3. C

    This program generates the output:

    This program generates the output:
  4. D

    This program generates the output:

    This program generates the output:
Show answer

Correct answer

  • A

    This program generates the output:

    This program generates the output:

Question 3

+4 marksOne correct option

Consider the Java code given below.

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

Consider the Java code given below.
Consider the Java code given below.
Consider the Java code given below.
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • A

    —

Question 4

+4 marksOne correct option

Consider the following block of code.

Which among the following code blocks can replace the given code in order to generate a customized assertion error as shown below?

Consider the following block of code.
Consider the following block of 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 5

+4 marksOne correct option

Consider the Java code given below.

Choose the correct option.

Consider the Java code given below.
  1. A

    It generates the output:

    It generates the output:
  2. B

    Compilation fails because and cannot be converted to

  3. C

    Compilation fails because method has not been defined in classes and

  4. D

    It generates the output:

    It generates the output:
Show answer

Correct answer

  • D

    It generates the output:

    It generates the output:

Question 6

+4 marksOne correct option

Consider the Java code given below.

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

+4 marksOne correct option

Consider the Java code given below.

Choose the correct option.

Consider the Java code given below.
  1. A

    This program generates the output:

  2. B

    This program generates the output:

  3. C

    This program generates the output:

  4. D

    This program generates the output:

Show answer

Correct answer

  • C

    This program generates the output:

Question 8

+4 marksOne correct option

Consider the Java code given below.

Choose the correct option to fill in the blank at such that the program generates the following output.

Consider the Java code given below.
Consider the Java code given below.
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    All of these.

Show answer

Correct answer

  • C

    —

Question 9

+4 marksOne correct option

Consider the Java code given below.

Choose the correct option.

Consider the Java code given below.
  1. A

    This program generates the output:

    This program generates the output:
  2. B

    This program generates the output:

    This program generates the output:
  3. C

    This program generates the output:

    This program generates the output:
  4. D

    This program terminates abnormally due to unhandled exception(s).

Show answer

Correct answer

  • B

    This program generates the output:

    This program generates the output:

Question 10

+4 marksOne correct option

Consider the Java code given below.

Choose the correct option.

Consider the Java code given below.
  1. A

    It generates the output:

  2. B

    It generates the output:

  3. C

    It generates the output:

  4. D

    It generates the output:

Show answer

Correct answer

  • C

    It generates the output:

Question 11

+4 marksOne correct option

Consider the Java code given below. Suppose the file is written successfully by the program.

What will the output be?

Consider the Java code given below. Suppose the file  is written successfully by the program.
  1. A

    —

  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 12

+4 marksOne correct option

Consider the code given below that checks whether two normal distributions are identical. Method is overridden to compare two objects as follows. If two distributions have the same mean and variance, then both are considered identical. Based on the given information, answer the question that follows.

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

Consider the code given below that checks whether two normal distributions are identical. Method  is overridden to compa
Consider the code given below that checks whether two normal distributions are identical. Method  is overridden to compa
  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 following Java code that uses chained exceptions.

What can be the output of this code?

Consider the following Java code that uses chained exceptions.
  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

Method returns an infinite sequential ordered produced by iterative application of a function to an initial element , producing a consisting of , , , etc. Based on the above information, consider the code given below, and answer the question that follows.

What will the output be?

Method  returns an infinite sequential ordered  produced by iterative application of a function  to an initial element
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • A

    —

Question 15

+4 marksOne correct option

Consider the code given below.

Choose the correct option.

Consider the code given below.
  1. A

    The code always prints 2000.

  2. B

    The code prints any number in the range 1000 to 2000

  3. C

    The code prints any number in the range 0 to 1000

  4. D

    The code always prints 1000.

Show answer

Correct answer

  • B

    The code prints any number in the range 1000 to 2000

Question 16

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

  • D
    Figure from the original question paper

Question 17

+4 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 18

+4 marksOne or more correct options

From among the options, identify the appropriate function header(s) for function that takes as input an array of objects and prints the highest salary among them.

Choose the correct option(s).

From among the options, identify the appropriate function header(s) for function  that takes as input an array of  objec

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

    —

Question 19

+6 marksOne correct option

Consider the Java code given below.

Which of the following is NOT true about the given code?

Consider the Java code given below.
  1. A

    This program may generate .

  2. B

    The program may generate the output:

    The program may generate the output:
  3. C

    The program may generate the output:

    The program may generate the output:
  4. D

    The program may generate the output:

    The program may generate the output:
Show answer

Correct answer

  • A

    This program may generate .

Question 20

+6 marksOne correct option

Consider the Java code given below.

Choose the correct option to be filled in place of such that the above program produces the GUI given below.

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 21

+5 marksOne correct option

Consider the code given below.

What will the output be?

Consider the code given below.
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • C

    —

Question 22

+5 marksOne correct option

Method returns an that describes the specific value, if non-null; otherwise returns an . Based on this description, consider the code given below, and answer the question that follows.

Choose the correct option.

Method  returns an  that describes the specific value, if non-null; otherwise returns an  . Based on this description, c
  1. A

    This program generates the output:

    This program generates the output:
  2. B

    This program terminates due to after printing the message:

    This program terminates due to  after printing the message:
  3. C

    This program generates the output:

    This program generates the output:
  4. D

    This program generates the output:

    This program generates the output:
Show answer

Correct answer

  • A

    This program generates the output:

    This program generates the output:

Question 23

+6 marksOne or more correct options

Consider the following code which has 4 user-defined threads, two threads would work as stock adders to a warehouse (object) and the other two work as stock removers from the same warehouse.

Choose all the options that would NEVER occur as a result of execution of this code.

Consider the following code which has 4 user-defined threads, two threads would work as stock adders to a warehouse (obj

Select all that apply.

  1. A

    It may generate the output as:

    It may generate the output as:
  2. B

    It may generate the output as:

    It may generate the output as:
  3. C

    It may generate the output as:

    It may generate the output as:
  4. D

    It may generate the output as:

    It may generate the output as:
Show answer

Correct answers

  • A

    It may generate the output as:

    It may generate the output as:
  • B

    It may generate the output as:

    It may generate the output as: