boolean keyword in Java

The boolean keyword is used to declare a variable as a boolean type, which represents only either true or false. For example: boolean isActive;   boolean isAdmin; boolean isActive; boolean isAdmin; The boolean keyword can be used to declare a type of a method parameter as below: public void sendEmail(boolean isAdmin) {       […]

Share this article on