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 Player0
  9. {
  10. public int hp;
  11. public int place;
  12. public void initi(){
  13. hp=100;
  14. place=0;
  15. }
  16. public void work(){
  17. hp=hp-1;
  18. place=place+1;
  19. }
  20. public void print(){
  21. System.out.println(hp);
  22. System.out.println(place);
  23. }
  24. }
  25. class Ideone
  26. {
  27. public static void main(String[] args){
  28. Player0 p=new Player0();
  29. p.initi();
  30. p.print();
  31. p.work();
  32. p.print();
  33. }
  34. }
  35.  
Success #stdin #stdout 0.06s 16500KB
stdin
Standard input is empty
stdout
100
0
99
1