If a and b are boolean expressions, then a & b is true only if ______.
- a or b
- both a and b
- either a or b
- neither a nor b
In Java, the '&' operator is a bitwise AND operator. To perform a logical AND operation on boolean expressions, you should use '&&' instead. It returns true if both 'a' and 'b' are true.
Loading...
Related Quiz
- Can a constructor be private in Java?
- Which of the following primitive data types has the largest size in memory?
- Which method is used to display a stage in JavaFX?
- Which access modifier allows a member to be accessed from within its own class only?
- The keyword ________ is used within a constructor to call another constructor in the same class.