fork download
  1. class Ideone {
  2. public static void main (String[] args) {
  3. int x = 10;
  4. boolean cond = x == 10;
  5. System.out.println(cond);
  6. if (cond) System.out.println("executou");
  7. cond = metodo();
  8. System.out.println(cond);
  9. if (cond) System.out.println("executou");
  10. System.out.println(x == 10);
  11. if (x == 10) System.out.println("executou");
  12. System.out.println(metodo());
  13. if (metodo()) System.out.println("executou");
  14. }
  15. public static boolean metodo() {
  16. return true;
  17. }
  18. }
  19.  
  20. //https://pt.stackoverflow.com/q/165494/101
Success #stdin #stdout 0.08s 32436KB
stdin
Standard input is empty
stdout
true
executou
true
executou
true
executou
true
executou