fork(2) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. class Ideone
  8. {
  9. public static Runnable createRunnable() {
  10. return () -> {};
  11. }
  12.  
  13. public static void main (String[] args) throws java.lang.Exception
  14. {
  15. Runnable r1 = () -> {};
  16. Runnable r2 = () -> {};
  17. System.out.println(r1 == r2);
  18.  
  19. Runnable r3 = createRunnable();
  20. Runnable r4 = createRunnable();
  21. System.out.println(r3 == r4);
  22. }
  23. }
Success #stdin #stdout 0.19s 320704KB
stdin
Standard input is empty
stdout
false
true