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:38] gthanos [1ος τρόπος - For-Each Loop] |
java:jfc_intf_collection [2021/05/22 03:47] gthanos [1ος τρόπος - For-Each Loop] |
||
|---|---|---|---|
| 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 37: | Line 38: | ||
| ==== 2ος τρόπος - iterator ==== | ==== 2ος τρόπος - iterator ==== | ||
| - | Μπορείτε να αντικαταστήσετε την '' | + | Μπορείτε να αντικαταστήσετε την '' |
| <code java> | <code java> | ||
| - | public void iterateList() { | + | public |
| Iterator< | Iterator< | ||
| while( it.hasNext() ) { | while( it.hasNext() ) { | ||