Sunday, August 15, 2010

list and getCollection()

Courtesy of Sun Web Learning Center

- list is a reference to a valid collection
- getCollection() returns a reference to a valid collection

Which two are valid? (Choose two.)

A     for(Object o ; list)
B     for(Object o : list.iterator())
C     for(Object o : getCollection())
D     for(Iterator i ; list.iterator() ; i.hasNext() )
E     for(Iterator i = list.iterator(); i.hasNext(); )

No comments:

Post a Comment