Hi everybody,
What should be the output of the following code? The answer given is wrong in my opinion. Please help.
Q. If you compile the following code what will be the result?
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"
Thanx
Jyotsna