title: get the type of String object - java
body: <p>I'm trying to find the hierarchy of the Object - "String" using the below method.</p>
  
  <pre><code>public class test{
  
      public static void main(String[] args){
          String x = "Test";
          System.out.println(x.getClass().getClass());
      }
  }       
  </code></pre>
  
  <p>The first x.getclass() return </p>
  
  <pre><code>Output:
  
      class java.lang.String
  </code></pre>
  
  <p>then -System.out.println(x.getClass().getClass());</p>
  
  <pre><code>Output:
         class java.lang.Class
  </code></pre>
  
  <p>and anything after that yields the same result</p>
  
  <p>System.out.println(x.getClass().getClass().getClass().getClass());</p>
  
  <p>Shouldn't it at some point lead to - java.lang.Object??</p>