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