Question: Consider the following two methods that appear within a single class. public void changeIt ( int [ ] list, int num ) { list =

Consider the following two methods that appear within a single class.
public void changeIt(int[] list, int num)
{
list = new int[5];
num =0;
for (int x =0; x < list.length; x++)
list[x]=0;
}
public void start()
{
int[] nums ={1,2,3,4,5};
int value =6;
changeIt(nums, value);
for (int k =0; k < nums.length; k++)
System.out.print(nums[k]+"");
System.out.print(value);
}
What is printed as a result of the call start()?
Responses
000000
000000
000006
000006
123456
123456
123450
123450
changeIt will throw an exception.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!