A good answer might be:Yes, the last statement constructs a new string. |
String Objects are Immutable
Strings are immutable.
The last statement constructs a new
string containing the characters from the original string with
additional characters at the end.
After the statement has executed, String objects, once constructed, can never be changed. This has many advantages in making programs understandable and reliable. For example, if a method has a reference to a string, that string will always contain the same characters, no matter what other methods are called.
For this reason, a program that does only moderate amounts
character of character manipulation should do it all using
class
However, constantly creating new |
QUESTION 2:A program is run from the command line as follows: C:\>java myProgram "Input String"
When refer to? Click Here after you have answered the questionargs[0] |