Java TOPIC 23 – ENHANCED FOR LOOP LESSON WORK QUESTION 1 QUESTION 2 a) Create a Stack object that holds 5
numbers. b) Using an enhanced for loop, output
each stack item to the screen (using the pop method). Notice that this gives you an error. c) Replace the above for loop by a
traditional for loop. Careful, that you loop the correct number of times! |
|