I found this code in a book and I executed it in Netbeans:
boolean b = false; if(b = true) { System.out.println(\"true\"); } else { System.out.printl
In your "if" statement you are assigning the value "true" to b. You should check the value by using the comparison operator "==".
boolean b = false; if(b == true) { System.out.println("true"); } else { System.out.println("false"); }