Question: JAVA: In the following program, for each name A, B, C, D, E, F, G of a variable or method, state the locations (1 to
JAVA: In the following program, for each name A, B, C, D, E, F, G of a variable or method, state the locations (1 to 9) which are in the scope of the variable. For example, for variable A you would write 1 - 9 or all.
public class ScopeTest { public static int A = 2; // location 1 public static void B( int C ) { // location 2 } public static void main (String[] argv) { // location 3 int D = 2; // location 4 for( int E = 0; E < 10; ++E ) { // location 5 if( D < A ) { int F = 1; // location 6 } // location 7 } // location 8 } // location 9 public static int G = 2; } Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
