| [ Web Proxy ] |
| Viewing: https://raw.githubusercontent.com/janbodnar/Java-Advanced/master/functional/ConsumerEx3.java | [Back] [Original] |
package com.zetcode;
import java.util.List;
import java.util.function.Consumer;
public class ConsumerEx3 {
public static void main(String[] args) {
var words = List.of("falcon", "wood", "rock", "forest",
"river", "water");
words.forEach(new Consumer() {
@Override
public void accept(String s) {
System.out.println(s);
}
});
}
}
| Web Proxy Viewer | New URL | Original Page |