fork(1) download
  1. class Player0 {
  2. public int hp;
  3. public int place;
  4.  
  5. public void initi() {
  6. hp = 100;
  7. place = 0;
  8. }
  9.  
  10. public void work() {
  11. hp -= 1;
  12. place += 1;
  13. }
  14.  
  15. public void print() {
  16. System.out.println("hp: " + hp + ", place: " + place);
  17. }
  18. }
  19.  
  20. class Game0 {
  21. public static void main(String[] args) {
  22. Player0 p = new Player0();
  23.  
  24. p.initi();
  25.  
  26. p.print();
  27.  
  28. p.work();
  29.  
  30. p.print();
  31. }
  32. }
Success #stdin #stdout 0.15s 19116KB
stdin
Standard input is empty
stdout
hp: 100, place: 0
hp: 99, place: 1