fork download
  1. import java.io.*;
  2.  
  3. class torch {
  4.  
  5. boolean Well;
  6. int checker = 0;
  7. int starter = 0;
  8.  
  9.  
  10. public void main (String args[]) {
  11. /* Source void objects here */
  12. torch m = new torch();
  13. System.out.println("onAppRun");
  14. System.out.println("Well " + Well + " checker " + checker + " starter " + starter + ".");
  15. System.out.println("----------");
  16. m.onAppRun();
  17. System.out.println("----------");
  18. System.out.println("onCheck");
  19. System.out.println("Well " + Well + " checker " + checker + " starter " + starter + ".");
  20. System.out.println("----------");
  21. m.onCheck();
  22. System.out.println("----------");
  23. System.out.println("torchOn");
  24. System.out.println("Well " + Well + " checker " + checker + " starter " + starter + ".");
  25. System.out.println("----------");
  26. m.torchOn();
  27. }
  28.  
  29. void onAppRun () {
  30. System.out.println("The system will now go through the paces of turing on a torch, the torch will definitely, inevitably turn on. This program shows you what happens.");
  31. System.out.println("The first piece of code to run is what is writing this called 'onAppRun'.");
  32. checker = 1;
  33. }
  34.  
  35.  
  36. void onCheck () {
  37. if (checker == 1)
  38. System.out.println("This piece of code checks that onAppRun has completed its process then tells the program so.");
  39. starter = 1;
  40. }
  41.  
  42.  
  43. void torchOn () {
  44. if (starter == 1 && checker == 1)
  45. Well = true;
  46. System.out.println("This code asks for both the checker and stater variables before starting, all this code does it turn the torch on.");
  47. System.out.println("Well is the torch on. Well = " + Well +".");
  48. }
  49.  
  50.  
  51.  
  52.  
  53. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
spoj: The program compiled successfully, but main class was not found.
      Main class should contain method: public static void main (String[] args).
stdout
Standard output is empty