I am in the unfortunate position of trying to learn Java at the same time that I'm teaching it! Our textbook is "Java: How to Program," 3rd ed., by Deitel and Deitel. It leaves much to be desired. But I have two questions about objects of class String.
(1) Why don't they need to be created using "new"? The declaration "String str" seems to be sufficient. Deitel says (p. 134) that all objects are created using "new."
(2) Deitel says (p. 370) that objects of class String are "immutable"--cannot be changed after being created. Yet in the very example program he is discussing (p. 369), he declares "String output" and then has numerous lines "output +=..." that obviously CHANGE "output." What is the explanation of this inconsistency?
Thanks