title: Manipulate Java object reference using class constructor
body: <p>This was an exam question which I couldn't complete.</p>
  
  <blockquote>
    <p>How do you get the following java code to print <strong>false</strong> by only
    editing code within the <em>MyClass</em> constructor? </p>
  
  <pre><code>public class MyClass{        
      public MyClass(){
      }
  
      public static void main(String[] args) {            
          MyClass m = new MyClass();
          System.out.println(m.equals(m));
      }
  }
  </code></pre>
    
    <p>You are NOT allowed to override the <em>equals</em> method, or change any of
    the code within the main method. The code must run without the program
    crashing.</p>
  </blockquote>
  
  <p>According to my research, you can't set a Java object reference to null when you instantiate a class. So I'm officially stumped.</p>