= Consider the following two code snippets (A and B): A: public static void main(String[] args ) { int i 0; for (i 0; i
Posted: Sat Feb 19, 2022 3:21 pm
= Consider the following two code snippets (A and B): A: public static void main(String[] args ) { int i 0; for (i 0; i < 10; i++) { System.out.println( "i is + i); } } = - B: public static void main(String[] args ) { for (int i 0; i < 10; i++) { System.out.println( "i is " + i); } } In which snippet, A or B, variable i has a greater ("wider") scope? A Same scope in both A and B. B Variable i has no scope.