Question: Consider the following methods. public void modParams ( int [ ] x , int [ ] y , String [ ] s ) { x

Consider the following methods.
public void modParams( int [] x, int [] y, String [] s)
{
x [1]=5;
y = x;
s [1]= new String(five);
s = new String [3];
s [1]= new String (six);
}
public void print ()
{
int [] a ={1,2,3};
int [] b ={11,22,33};
String[] s ={one,two,three);
modParams(a, b, s);
System.out.println(a[1]++ b[1]++ s[1]);
}
What is printed when print is called?
a.
222 two
b.
522 two
c.
55 two
d.
522 five
e.
55 six

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 Programming Questions!