Question: 4. Consider the following two Java code segments Segment i int i = 0; ment 2 for ( int i = 0; i 0;-j )


4. Consider the following two Java code segments Segment i int i = 0; ment 2 for ( int i = 0; i 0;-j ) ++counter } // end main } // end class TestB Which of the following statements is true? a. The value of counter will be different at the end of each for loop for each class. b. The value ofj will be the same for each loop for all iterations c. Both (a) and (b) are true d. Neither (a) nor (b) is true
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
