Question 1 | MCQ
THIS IS QUESTION PAPER FOR THE SUBJECT"DIPLOMA LEVEL : PROGRAMMING CONCEPTS
USING JAVA (COMPUTER BASED EXAM)"
ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.
(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)
USING JAVA (COMPUTER BASED EXAM)"
ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.
(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)
Solution
Consider the Java code given below.

Immediately after the execution of Line 8, the activation record of which method is at the top of the stack of activation records?
Immediately after the execution of Line 8, the activation record of which method is at the top of the stack of activation records?
Solution
Consider the Java code given below.

What will the output be?
What will the output be?
Solution
Consider the code given below.

Choose the correct option regarding the code.
Choose the correct option regarding the code.
Solution
Consider the Java code given below.

Choose the correct option.
Choose the correct option.
Solution
Consider the code given below.

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

Choose the correct option to fill in place of
Solution
Consider the Java code given below.

What will the output be?
What will the output be?
Solution
Consider the code given below.

What will the output be?
What will the output be?
Solution
Consider the following block of code.

Assume that assertions are enabled during program execution. Which among the following code blocks can replace the given code in order to generate an
with acustomized assertion erroras shown below?

Assume that assertions are enabled during program execution. Which among the following code blocks can replace the given code in order to generate an
Solution
Consider the Java code given below.

What will the output be?
What will the output be?
Solution
Consider the Java code given below.

What will the output be for the above Java code?
What will the output be for the above Java code?
Solution
Method
returns an
describing the specified value, if non-null, otherwise returns an empty
.
Based on this description, consider the code given below, and answer the question that follows.

Choose the correct option.
Based on this description, consider the code given below, and answer the question that follows.
Choose the correct option.
Solution
Consider the Java code given below.

Choose the correct option.
Choose the correct option.
Solution
Consider the code given below.

What will the output be?
What will the output be?
Solution
Consider the code given below.Assume that the file
contains the following lines of text in it.


Choose the correct option.
Choose the correct option.
Solution
Consider the following code which converts temperatures given in Centigrade scale to Fahrenheit scale and vice versa, using two threads. Once the conversion is finished, the program should check whether there is a temperature value in the array which is the same in both the scales.


is the only temperature which is same in both the scales. Choose the correct option which should be written in place of
, so that this program produces the result as
on every execution.
Solution
Consider the Java code given below.

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

Choose the correct option to fill in the blank at
Solution
Method
of interface
has the following structure and functionality:

If the specified key is not already associated with a value or is associated with null, associates it with the given non-null value. Otherwise, replaces the associated value with the results of the given remapping function, or removes if the result is null.
Consider the code given below that uses the merge method to combine scores of players and answer the question that follows.

Choose the correct option regarding the code.
If the specified key is not already associated with a value or is associated with null, associates it with the given non-null value. Otherwise, replaces the associated value with the results of the given remapping function, or removes if the result is null.
Consider the code given below that uses the merge method to combine scores of players and answer the question that follows.
Choose the correct option regarding the code.
Solution
Consider the Java code given below.

Which of the following is NOT true about the given code.
Which of the following is NOT true about the given code.
Solution
The Java code given below produces a toggle button. With the first click, the traffic signal should be switched to green, with the next click it should be switched to red, and on the next click it should be switched to green again, and so on. Based on the requirement, answer the question that follows the code.

Choose the correct code segment inside method
such that the given behaviour can be implemented correctly.
Choose the correct code segment inside method
Solution
Consider the following Java code and choose the correct option.

Solution
Consider the code given below.

Identify the appropriate option to fill in the blank at
, such that the threads
and
execute the
function in parallel.
Identify the appropriate option to fill in the blank at
Solution
Consider the Java code given below.

Choose the correct option(s).
Choose the correct option(s).
Solution
Consider the Java code given below.

Which of the following options is/are possible result/s of the above code?
Which of the following options is/are possible result/s of the above code?
Solution
Shape
Thickness [ / ]
3
All colors