123456789101112131415



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

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. 0 1 2 3 4
3. 0 2 3 4 5
4. 2 3 4 5 0