Guest User

Untitled

a guest
Apr 25th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. public static void main(String[] args) {
  2. class Test implements Consumer<String> {
  3. @Ovrride
  4. public void accept(String value) {
  5. System.out.println(value);
  6. }
  7. }
  8.  
  9. Consumer<String> first = new Test();
  10.  
  11. Consumer<String> second = new Consumer<String>() {
  12. @Ovrride
  13. public void accept(String value) {
  14. System.out.println(value);
  15. }
  16. };
  17.  
  18. Consumer<String> third = (String value) -> System.out.println(value);
  19.  
  20. Consumer<String> fourth = value -> System.out.println(value);
  21.  
  22. Consumer<String> fifth = System.out::println;
  23. }
Add Comment
Please, Sign In to add comment