Consider the following class definition.
public class Silly
{
private int var1;
private String var2;
public Silly(int v1, String v2)
{
var1 = v1;
var2 = v2;
}
public boolean equals(Object other)
{
if (other == null)
{
return false;
}
Silly s = (Silly) other;
return (var1 == s.var1
&& var1 == var2.length()
&& var2.length() == s.var2.length());
}
}
The following code segment appears in a class other than Silly.
Silly s1 = new Silly(3, "abcd");
Silly s2 = new Silly(3, "abcd");
Silly s3 = new Silly(5, "vwxyz");
Silly s4 = new Silly(5, "aaaaa");
Silly s5 = new Silly(5, "efg");
Which of the following Boolean expressions will evaluate to true ?
A. s1.equals(s2)
B. s2.equals(s3)
C. s3.equals(s4)
D. s4.equals(s5)
E. s5.equals(s1)