fork 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--;
  12. place++;
  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. p.initi();
  24. p.print();
  25. p.work();
  26. p.print();
  27. }
  28. }
  29.  
  30.  
Success #stdin #stdout 0.15s 19116KB
stdin
Standard input is empty
stdout
hp:100,place:0
hp:99,place:1