Consider the following code segment: String[] firstArray, secondArray; String s1, s2; s1 = rack; s2 = train;
Fantastic news! We've Found the answer you've been seeking!
Question:
Consider the following code segment:
String[] firstArray, secondArray;
String s1, s2;
s1 = "rack";
s2 = "train";
s2 = "t" + s1;
firstArray = new String[3];
secondArray = firstArray;
firstArray[0] = s1;
firstArray[1] = s1;
firstArray[2] = s1;
secondArray[1] = s2;
s1 = "train";
for (int k = 0; k < 3; k++)
System.out.print(firstArray[k] + " ");
What happens when this code segment executes?
Related Book For
Accounting for Decision Making and Control
ISBN: 978-1259564550
9th edition
Authors: Jerold Zimmerman
Posted Date: