- Consider The Following Two Code Snippets A And B A Public Static Void Main String Args Int I 0 For I 0 I 1 (52.04 KiB) Viewed 17 times
= Consider the following two code snippets (A and B): A: public static void main(String[] args ) { int i 0; for (i 0; i
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
= Consider the following two code snippets (A and B): A: public static void main(String[] args ) { int i 0; for (i 0; i
= 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.