public static void main(String[] args) {
String[] arr = new String[5];
for (int i = 0; i < arr.length; i++) {
arr[i] = "aaa" + i;
}
System.out.println(arr[0] == "aaa0"); // false
String s = "aaa0";
System.out.println(s == arr[0]); // false
}
I have a few question regarding the topic could help me to understand
What are logins behind the fact that String from string arrays don't automatically go to Sting pool, unlike string literals?
Do I correctly understand that only string literals go to the String pool implicitly ?
Do I correctly understand that string array from public static void main ( public static void main(String[] args) ) is not go to the String pool too ?