A quiz taken in a data structure class
<p>Wanted an explanation on the results of question 1.</p>

<p>***1. What is the output of the following method?</p>

<pre><code>public static void main(String[] args) {
    Integer i1=new Integer(1);
    Integer i2=new Integer(1);
    String s1=new String("Today");
    String s2=new String("Today");

    System.out.println(i1==i2);
    System.out.println(s1==s2);
    System.out.println(s1.equals(s2));
    System.out.println(s1!=s2);
    System.out.println( (s1!=s2) || s1.equals(s2));
    System.out.println( (s1==s2) &amp;&amp; s1.equals(s2));
    System.out.println( ! (s1.equals(s2)));
}
</code></pre>

<p>Answer:</p>

<pre><code>false
false
true
true
true
false
false
</code></pre>

<hr>
