001package state.one; 002 003interface I { 004 public int f(); 005 public int g(); 006 public void changeDirection(); 007} 008 009class C implements I { 010 private boolean state; 011 private int i; 012 private int j; 013 public int f() { 014 if (state) 015 i += 26; 016 else 017 i -= 32; 018 return i; 019 } 020 public int g() { 021 if (state) 022 j += 42; 023 else 024 j -= 27; 025 return j; 026 } 027 public void changeDirection() { 028 state = !state; 029 } 030}