| Summary: | Misleading error | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Jonathan Camilleri <camilleri.jon> | ||||
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> | ||||
| Status: | RESOLVED INVALID | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | daniel_megert, eclipse | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 193969 [details]
Source code (dummy)
Sorry, where in that example are you attempting to iterate over an ArrayList using the foreach syntax? (In reply to comment #2) > Sorry, where in that example are you attempting to iterate over an ArrayList > using the foreach syntax? Yes, is my coding incorrect? (In reply to comment #3) > (In reply to comment #2) > > Sorry, where in that example are you attempting to iterate over an ArrayList > > using the foreach syntax? > Yes, is my coding incorrect? I found a sample at http://leepoint.net/notes-java/flow/loops/foreach.html. Bugzilla is not here to answer coding questions. Use a Java newsgroup for that. (In reply to comment #5) > Bugzilla is not here to answer coding questions. Use a Java newsgroup for that. Noted |
Build Identifier: M20110210-1200 I'm trying to code as follows, however, I'm getting an error message, any idea why? private static ArrayList<Player> getWinner(ArrayList<Player> _players) { ... for (int i = 0; i < _players.size(); i++) { for (Card _card: _players.get(i)) { } } return _winners; ... } Error: Can only iterate over an array or an instance of java.lang.Iterable According to the Java API for 1.6, ArrayList implements Iterable<E> - http://download.oracle.com/javase/6/docs/api. Reproducible: Always