fork download
  1. class Ideone {
  2. public static void main(final String[] args) {
  3. final Ideone thing = new Ideone();
  4. System.out.println(thing.leaves);
  5. thing.foo(thing);
  6. System.out.println(thing.leaves);
  7. }
  8.  
  9. private int leaves;
  10.  
  11. public Ideone() {
  12. }
  13.  
  14. public void foo(Ideone this, final Ideone self) {
  15. this.leaves++;
  16. self.leaves++;
  17. }
  18. }
  19.  
Success #stdin #stdout 0.06s 32280KB
stdin
Standard input is empty
stdout
0
2