public class DemoBool { public static void main(String[] args) { boolean b = false; //or true System.out.println(b); int i = 10; int j = 20; //Save the relationship of i and j for later use. b = (i < j); //parentheses unnecessary System.out.println(b); if (b) { //or if (!b) { System.out.println("i was less than j."); } } }