This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
java:jfc_intf_collection [2021/05/22 03:40] gthanos [2ος τρόπος - iterator] |
java:jfc_intf_collection [2021/05/22 02:47] (current) |
||
|---|---|---|---|
| Line 24: | Line 24: | ||
| | | ||
| public static void main(String args[]) { | public static void main(String args[]) { | ||
| + | Collection< | ||
| students = new LinkedList< | students = new LinkedList< | ||
| students.add(new Student(" | students.add(new Student(" | ||
| Line 39: | Line 40: | ||
| Μπορείτε να αντικαταστήσετε την '' | Μπορείτε να αντικαταστήσετε την '' | ||
| <code java> | <code java> | ||
| - | public void iterateCollection(Collection< | + | public |
| Iterator< | Iterator< | ||
| while( it.hasNext() ) { | while( it.hasNext() ) { | ||