Connecting arrays question
This may be a silly question although I could see no other way of doing it. If there is a more simple way then please let me know.
Thank you anyone
/**
* Complete the program so that a new array twice is constructed.
* Now copy values from val to twice, but make the values in twice
* double what they are in val.
*/
class ArrayCopy
{
publicvoid process ( String[] argStrings )
{
int[] val ={13, -4, 82, 17};
int[] twice ={(val[0]*2), (val[1]*2), (val[2]*2), (val[3]*2)};//This used to be blank
System.out.println("Original Array: "
+ val[0] +
" " + val[1] +
" " + val[2] +
" " + val[3] );
// Put values in twice that are twice the
// corresponding values in val.
System.out.println("New Array: "
+ twice[0] +
" " + twice[1] +
" " + twice[2] +
" " + twice[3] );
}
}

