JAVA 8: Streaming a String

Streaming a String using Java 8.

public static void main(String[] args) {
        "hey duke".chars().forEach(c -> System.out.println((char)c));
    }

The parallel version does not preserve the order (and comes with additional overhead):

public static void main(String[] args) {
        "hey duke".chars().parallel().forEach(c -> System.out.println((char) c));
    }

Enjoy Java 8!