If user passes a primitive type argument to println(), what exactly happens behind the scene? e.g.
int i =1;
System.out.println("My Int"+i);
//and in
System.out.println(i)
How does it print "My Int 1" and "1", even though it needs a String object?
updated..
What I think is AutoBoxing comes into play. Is that true, too?
It does not need a String object, and there is no autoboxing at play here, either. There are methods for primitive types as well: