All pastes #936824 Raw Edit

nukka

public text v1 · immutable
·published 2008-03-10 17:55 UTC
rendered paste body
18. Java 1.5 also added a new version of the for loop, called the for-each loop. It enables one to traverse ANY array, or ANY list of objects as long as the class containing the list implements the Iterable interface. The advantage is that no indices or methods of the class are necessary, and the list will be traversed in its intrinsic order. Which of the following would print out the values of all the variables in the ArrayList defined as
      ArrayList<String>oList=new ArrayList<String>();
 Answer: B) for(String sA : oList) System.out.println(sA);