If I compile the code
public static void main(String[] args) { Object a; a = "test"; System.out.println(a); }
and run
javap -c Main
I see
public static void main(java.lang.String[]); Code: 0: ldc #2
You can see getstatic loading the System.out field
The object does not have a method called out() , so I do not believe that you are looking at the code that you think.
getstatic gets static fields, for example. System.out is the static field of the system, so if you write
System.out.println();
This will result in using getstatic
source share