There is a compilation error when trying to compile
String s = "65535 символов на одну больше чем 2 в степени 16" but 65,534 characters compiles, for some reason, why a string pool cannot contain more than two byte lines? plus it is logical that the maximum size of a string can only be Integer.MAX_VALUE, because string.length () returns an int, but something when trying to run
while (true) {//делал такое и со String, сути и ошибки не меняются stringBuilder.append(stringBuilder); System.out.println(stringBuilder.length()); } gives an error message
536829952 Exception in thread "main" java.lang.OutOfMemoryError: Java heap space Not even close to the maximum value of int.