Posted By:
Roger_Hand
Posted On:
Friday, July 26, 2002 01:30 AM
After you've added a reference to the {"happy", "BirthDay"} array to the Vector, you change the array to be {"to","you"} and add another reference to the same array to the Vector. The vector now holds two references to the same array, which now contains {"to","you"}.
You can get what (I think) you want by putting
row = new String[2];
after adding {"happy","BirthDay"} and before setting the array to {"to","you"}. This will create a new array, so you'll have two arrays, the Vector will hold two references to the two arrays, and you'll get all four words output.