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 String foo = "";
  11.  
  12. public static Ideone process(final Ideone t) {
  13. System.out.println(t.toString() + " = " + t.foo);
  14. t.foo = "bar";
  15. new Runnable() {
  16. public void run() {
  17. System.out.println(t.toString() + " = " + t.foo);
  18. t.foo = "baz";
  19. }
  20. }.run();
  21. System.out.println(t.toString() + " = " + t.foo);
  22. return t;
  23. }
  24.  
  25. public static void main(String[] args) {
  26. process(new Ideone());
  27. }
  28.  
  29. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
Ideone@1e61582 = 
Ideone@1e61582 = bar
Ideone@1e61582 = baz