24. What will be the result of following program?
public class MyClass {
public static void main(String args[]) {
String str1 = "Test One";
String str2 = new String("Test One");
if ( str1.equals( str2) ) {
System.out.println("Both are equal");
}
boolean b = true;
boolean b1 = false;
if ( b.equals(b1) ) {
System.out.println("true");
}
}
}
[a] Compile time error
[b] Runtime error.
[c] No output
[d] "Both are equal" followed by "true"
Answer
[a] Compile time error |