Contact Us
|
Contribute
|
Ask Question
|
login
Subscribe Us
91-9990449935
0120-4256464
Java
T
point
Home
Java
C
SQL
Android
PHP
HTML
CSS
XML
JavaScript
Ajax
Cloud
Python
Web Services
Quiz
Projects
Interview Q
Comment
Forum
Training
Content Menu ▼
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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