1 Reply Latest reply: Apr 5, 2007 10:41 PM by DrClap RSS

    help with boolean variables

    807599
      What is the print out of this:

      boolean bool1 = true;
      boolean bool2 = true;
      boolean bool3 = false;

      if(bool1 && bool2 && bool3){
      System.out.print("One.");
      }else if(bool1 && bool2){
      System.out.print("Two.");
      }else if(bool1){
      System.out.print("Three.");
      }

      I think it's "Two."

      Am I right or wrong?