123456789101112131415



Question 1: What is the output of the following?
class ChangeIt
{
static void doIt( int[] z )
{
int[] A = z ;
A[0] = 99;
}
}

class TestIt
{
public static void main ( String[] args )
{
int myArray = {1, 2, 3, 4, 5} ;

ChangeIt.doIt( myArray );

for (int j=0; j<myArray.length; j++ )
System.out.print( myArray[j] + " " ) ;
}
}

1. 1 2 3 4 5
2. 99 2 3 4 5
3. 0 2 3 4 5
4. 99 99 99 99 99