= Consider the following two code snippets (A and B): A: public static void main(String[] args ) { int i 0; for (i 0; i
-
answerhappygod
- Site Admin
- Posts: 899604
- 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!