Question 5
Consider the Java code given below.
Choose the correct option.
It generates the output:

Compilation fails because and cannot be converted to
Compilation fails because method has not been defined in classes and
It generates the output:

Consider the Java code given below.
Choose the correct option.
It generates the output:

Compilation fails because and cannot be converted to
Compilation fails because method has not been defined in classes and
It generates the output:

Correct answer
It generates the output:

Question 5 of 23 in the IIT Madras BS Programming Concepts using Java (Java) End Term paper sat on 10 May 2026, in the January 2026 term (Programming Concepts Using Java 06 May 26). It carries 4 marks.