Java Reference
In-Depth Information
/** Swap the larger of b and c , if necessary, to get the larger in c . */
public static void swap( int b, int c) {
?
}
E36. Consider class C shown below. Draw a frame for the call meth(42, 43) ,
showing the state just after the arguments have been assigned to the parameters:
public class C {
public static void meth( int c, int d) { … }
}
E37. Consider the class C shown below.
public class C {
public static void meth( int c, int d) { … }
public static void m() { … }
}
Let the active frame be as shown below, and assume that this call appears in
method m : v.meth(45, 46); . Copy the active frame and folder a1 onto a piece
of paper and view the frame as the top frame in the call stack. Then execute the
method call, using the steps provided in Sect. 2.7.2 (omit the steps of executing
the method body and erasing the call.)
a1
m: 6
C
C
meth( int , int )
m()
v
a1
active frame
 
Search WWH ::




Custom Search