fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. List<String> list = new ArrayList<>();
  13. list.add("a");
  14. list.add("b");
  15. list.add("c");
  16. list.replaceAll(str -> str.toUpperCase());
  17. System.out.println(list);
  18.  
  19. //Function<String, Integer> func = Integer::parseInt;
  20. System.out.println(Integer::parseInt.apply("3"));
  21. }
  22. }
Compilation error #stdin compilation error #stdout 0.18s 3359744KB
stdin
Standard input is empty
compilation info
Main.java:20: error: method reference not expected here
		System.out.println(Integer::parseInt.apply("3"));
		                   ^
1 error
stdout
Standard output is empty