title: Are reference objects with different types any different in Java?
body: <p>When saying:</p>
  
  <pre><code>  String str = "hello";
    Object obj = str;
    System.out.println(str==obj);
  </code></pre>
  
  <p>The result is true, because it points to the same objects in memory, which makes sense. But if I say:</p>
  
  <pre><code>obj.indexOf("h");
  </code></pre>
  
  <p>Or any subclass method, I get "cannot find symbol". They're still pointing to the same object, so what's going on during compile-time that makes reference objects of different types different from each other?</p>