[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 :: Basic Concepts - Discussion

Home > JAVA Programming > Basic Concepts > MCQs Questions Discussion

54 / 64

What is the output for the below code?

public class Test {
enum Month { JAN, FEB, MAR };
public static void main(String... args) {
Month m1 = Month.JAN;
Month m2 = Month.JAN;
Month m3 = Month.FEB;
System.out.println(m1 == m;
System.out.println(m1.equals(m);
System.out.println(m1 == m;
System.out.println(m1.equals(m);
}
}

Atrue true true false

Btrue true false false

Cfalse false true true

DCompilation fails with an error at line 10

Answer: Option (Login/Signup)

Show Explanation

Asked In ::

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here