Home / Study library / Programming Concepts using Java / End Term · Sep 2025 Programming Concepts using Java · End Term · Sep 2025 · AN
Programming Concepts using Java · End Term · Sep 2025 AN
← Course papers · Start practice / exam
Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.
0 / 23 published solutions
Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22 Q23 Q24
Question 2 MCQ · 5.0 marks Consider the code given below.
Which of the following is **NOT true** about the given code?
A. This program may generate ConcurrentModificationException.
B. It may generate output:
C. It may generate output:
D. It may generate output:
A published solution is not available for this question yet.
Report a correction for Q2
Question 3 MCQ · 4.0 marks Consider the code given below.
How many activation records are created on the stack during the execution of the code?
A published solution is not available for this question yet.
Report a correction for Q3
Question 4 MSQ · 6.0 marks Consider the Java code given below.
Choose all the options which can be used in place of ARG in LINE 1 so that the code outputs the sum
of two coordinates.
A. B. C. D. A published solution is not available for this question yet.
Report a correction for Q4
Question 5 MSQ · 5.0 marks Consider the following Java code.
Identify the line/s which has/have errors.
A published solution is not available for this question yet.
Report a correction for Q5
Question 6 MCQ · 4.0 marks Consider the Java code given below.
Choose the correct option.
A. This program generates the output: [Amit, Neha, Sita]
B. This program generates the output: [Neha, Sita]
C. This program generates the output: [Ravi]
D. This program generates the output: [Amit, Ravi]
A published solution is not available for this question yet.
Report a correction for Q6
Question 7 MCQ · 4.0 marks Consider the Java code given below.
What will happen when the button (labelled "Press") is clicked?
A. The label will change to "Button Pressed'' when the button is clicked
B. The label remains "Start"
C. The code throws a runtime error
D. The button will disappear after clicking
A published solution is not available for this question yet.
Report a correction for Q7
Question 8 MSQ · 5.0 marks Consider the Java code given below.
Choose the correct options to be filled in place of CODE SEGMENT so that the label displays the text
entered in the text field.
A. B. C. D. A published solution is not available for this question yet.
Report a correction for Q8
Question 9 MSQ · 5.0 marks Consider the Java code given below.
Which of the following options is/are possible result/s of the above code?
A. B. C. D. A published solution is not available for this question yet.
Report a correction for Q9
Question 10 MSQ · 4.0 marks Consider the Java code given below.
Which of the following is/are possible output(s) of the above code?
A published solution is not available for this question yet.
Report a correction for Q10
Question 11 MCQ · 4.0 marks Assume that the file fruits.txt contains the following lines:
Consider the code given below.
Choose the correct option.
A. LINE 1 generates IOException.
B. This program generates the output:
C. This program generates the output:
D. This program generates the output:
A published solution is not available for this question yet.
Report a correction for Q11
Question 12 MCQ · 4.0 marks Consider the Java code given below.
What will the output be?
A. B. C. D. A published solution is not available for this question yet.
Report a correction for Q12
Question 13 MCQ · 4.0 marks Consider the Java code given below.
What will the output be?
A published solution is not available for this question yet.
Report a correction for Q13
Question 14 MCQ · 4.0 marks Method Optional.ofNullable(T value) returns an Optional that describes the specific value, if non-null;
otherwise returns an empty Optional.
Based on this description, consider the code given below, and answer the given question.
Choose the correct option.
A. This program generates the output:
B. This program terminates due to NullPointerException after printing:
C. This program generates the output:
D. This program generates the output:
A published solution is not available for this question yet.
Report a correction for Q14
Question 15 MCQ · 4.0 marks Consider the following Java code.
What will the output be?
A. B. C. D. A published solution is not available for this question yet.
Report a correction for Q15
Question 16 MCQ · 4.0 marks Consider the Java code given below.
Identify the appropriate statement to fill in the blank at LINE 1, such that the output
is:
A. ((Displayable)iter.get_next()).display();
B. ((Book)iter.get_next()).display();
C. ((Library)iter.get_next()).display();
D. iter.get_next().display();
A published solution is not available for this question yet.
Report a correction for Q16
Question 17 MCQ · 4.0 marks Method merge of interface Map 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 two maps, and answer the
given question.
Choose the correct option regarding the code.
A. It generates the output: {Apple=10, Banana=8, Orange=8}
B. It generates the output: {Apple=10, Banana=-2, Orange=8}
C. It generates the output: {Banana=-2, Apple=10, Orange=8}
D. It generates NullPointerException during runtime.
A published solution is not available for this question yet.
Report a correction for Q17
Question 18 MSQ · 6.0 marks Consider the code given below.
Identify the appropriate function header for function sum, such that the output is 78.0, 33.5.
A. B. C. D. A published solution is not available for this question yet.
Report a correction for Q18
Question 19 MCQ · 4.0 marks Consider the following Java code.
Choose the correct option when the class is executed as:
java -ea ShoppingTest
A. This code generates output: 2600.0
B. This code generates AssertionError: Item price must be positive
C. This code generates AssertionError: Adding item exceeds cart limit
D. This code generates AssertionError: Maximum limit must be positive
A published solution is not available for this question yet.
Report a correction for Q19
Question 20 MCQ · 4.0 marks Consider the following Java code that uses chained exceptions.
Which of following can be the output of this code?
A. B. C. D. A published solution is not available for this question yet.
Report a correction for Q20
Question 21 MCQ · 4.0 marks Consider the code given below.
Choose the correct option.
A. Compilation error at LINE 1 because method printQuality() is not overridden in
class EpsonPrinter
B. Compilation error at LINE 2 because method startPrint() is not overridden in class
CanonPrinter
C. This program generates the output:
D. This program generates the output:
A published solution is not available for this question yet.
Report a correction for Q21
Question 22 MCQ · 4.0 marks Consider the code given below.
Choose the correct option to fill in place of CODE BLOCK so that the output is:
A. B. C. D. A published solution is not available for this question yet.
Report a correction for Q22
Question 23 MCQ · 4.0 marks Consider the Java code given below.
Choose the correct option.
A. It generates the output as:
B. Compilation fails because Car and Bike do not override fuel()
C. Compilation fails because Car and Bike cannot be assigned to Vehicle
D. It generates the output as:
A published solution is not available for this question yet.
Report a correction for Q23
Question 24 MCQ · 4.0 marks Consider the Java code given below.
What will the output be?
A. B. C. D. A published solution is not available for this question yet.
Report a correction for Q24