1. Give the definition of a static method called showArray that has an array of
base type char as a single parameter and that writes one line of text to the
screen consisting of the characters in the array argument written in order.
2. Give the definition of a static method called getArrayOfHalves that has
an array of base type double as a single parameter and that returns another
array whose base type and length are the same as those of the parameter,
but whose elements have each been divided by 2.0.
3. The following method compiles and executes but does not work as you
might hope. What is wrong with it?
/** Copies an array. */
public static int[] copyArray(int[] anArray)
{
int[] temp = new int[anArray.length];
temp = anArray;
return temp;
}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here