Java examples for File Path IO:Scanner
Read boolean from console using Scanner
import java.util.Scanner; public class BooleanInputOutput { public static void main(String cLA[]) { Scanner myInput = new Scanner(System.in); boolean myBool = myInput.nextBoolean(); // true or false System.out.printf("%b\n", myBool); }//from w w w. j a v a 2 s.co m }