While making up some arrays I noticed that
char[] javaArray = {'j','a','v','a'};
prints out
java
but
String[] javaStringArray = {"j","a","v","a"};
only prints the stack location. I know char and String are both very different, but how come the JVM knows to output chars for the first and only a stack location for the second?
I am using IntelliJ and the command System.out.println(javaArray);