fork download
  1. /* package whatever; */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. class Ideone
  8. {
  9. //`result` is first set to false.
  10. private static Boolean result = false;
  11.  
  12. public static Boolean callthing() {
  13. try {
  14. //I set a 'new' result to 'true' here:
  15. Boolean result = true;
  16. }
  17. catch(Throwable e) {
  18. System.out.println(e.toString());
  19. }
  20. //But I am returning false!
  21. return result;
  22. }
  23.  
  24. public static void main (String[] args) throws java.lang.Exception
  25. {
  26. Boolean end = callthing();
  27. System.out.println(end); //Notice that it's false!
  28. }
  29.  
  30. }
Success #stdin #stdout 0.06s 380224KB
stdin
Standard input is empty
stdout
false