My answers would also be C and D.
However, I tried a small pgm and concluded that -
1.equals() returns true if both content and reference are same.
2.== returns true if just the refernces are same. which in turn makes the contents to be same too. right!!!
Any thoughts?
class Base {int i = 10;}
public class myjava {
private static void main(
String [] args){
Base b = new Base();
Base q = new Base();
System.out.print( "before equating :");
System.out.println("b.equals(q)=" + b.equals(q) + " (b == q) is " + (b==q));
q = b;
System.out.print( "after equating :");
System.out.println("b.equals(q)=" + b.equals(q) + " (b == q) is " + (b==q));
}
}