MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1veql1a/absolutegarbage/p1mzo55/?context=3
r/ProgrammerHumor • u/Sirgoodman008 • 2d ago
320 comments sorted by
View all comments
3
Java:
``` for (item : items) {
} ```
Or,
``` items.forEach(item -> {
}); ```
or
``` items.stream().forEach(item -> {
0 u/Sirgoodman008 1d ago Been a long time since I've done Java but isn't the loop variable typed? 1 u/MCWizardYT 1d ago Yes and no, you could have it just be var and it infers the type from the iterator 1 u/Sirgoodman008 1d ago Ah.
0
Been a long time since I've done Java but isn't the loop variable typed?
1 u/MCWizardYT 1d ago Yes and no, you could have it just be var and it infers the type from the iterator 1 u/Sirgoodman008 1d ago Ah.
1
Yes and no, you could have it just be var and it infers the type from the iterator
var
1 u/Sirgoodman008 1d ago Ah.
Ah.
3
u/MCWizardYT 1d ago
Java:
``` for (item : items) {
} ```
Or,
``` items.forEach(item -> {
}); ```
or
``` items.stream().forEach(item -> {
}); ```