fork download
  1. class Testing
  2. {
  3. public static boolean funcThatReturnsBool()
  4. {
  5. return true;
  6. }
  7. public static void main (String[] args)
  8. {
  9. if (funcThatReturnsBool())
  10. System.out.println("Yay, it works");
  11. else
  12. System.out.println("WTF?!");
  13.  
  14. boolean result = funcThatReturnsBool();
  15. if (result)
  16. System.out.println("Yay, it still works");
  17. else
  18. System.out.println("WTF (#2)?!");
  19. }
  20. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
Yay, it works
Yay, it still works