[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

JAVA Programming :: Objects and Classes - Discussion

Home > JAVA Programming > Objects and Classes > MCQs Questions Discussion

17 / 30

Choose the correct option.

What is the output for the below code ?

1. public class Test {
2. public static void main(String... args) {
3. Integer i = 34;
4. String str = (i<2?"jan":(i<56)?"feb":"march";
5. System.out.println(str);
6. }
7. }

Afeb

Bjan

Cmarch

DCompilation fails with an error at line 4

Answer: Option (Login/Signup)

Show Explanation

Asked In ::

Post Your Answer Here:     

No Discussion on this question yet!