deyanmalinov

01. Consumer Print - Functional Programming - Exercises

Apr 22nd, 2020
376
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package DPM;
  2.  
  3. import java.util.Arrays;
  4. import java.util.Scanner;
  5. import java.util.function.Consumer;
  6.  
  7. public class Main {
  8.     public static void main(String[] args) {
  9.         Scanner scan = new Scanner(System.in);
  10.         String[] line = scan.nextLine().split("\\s+");
  11.         Consumer<String > print = System.out::println;
  12.         Arrays.stream(line).forEach(print);
  13.     }
  14. }
RAW Paste Data