Question: 3 . ) Given the method implementation using the Location type as follows: public static void f ( int i , Location k ) {

3.) Given the method implementation using the Location type as follows:
public static void f(int i, Location k)
{
i+=1;
k.shift(2,0);
}
Suppose that a main program has an integer variable m(equal to zero), and a Location object n(with n.getx() equal to zero). Then the main program calls f(m,n); What are the values of m and n.getX() after the method f finishes?
A. Both m and n.get x() are still 0.
B.m is now 1, but n.getX() is still 0.
C.m is still 0, but n.get x() is now 2.
D.m is now 1, and n.get x() is now 2.
 3.) Given the method implementation using the Location type as follows:

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!