+ 1

Give me an example for boolean input plz

I coded this way Scanner c = new Scanner(System.in); char con = c.nextBoolean(); It saysboolean cannot be converted to char.

11th Apr 2017, 6:05 PM
Mohammed Arshad
Mohammed Arshad  - avatar
3 Antworten
+ 3
thats because a boolean cant be converted to a char.... a boolean is either true or false a char is a single character did you mean boolean con = c.nextBoolean ();
11th Apr 2017, 7:47 PM
Edward
+ 1
Plz explain me how does a boolean function work? How do we use it to get input. In javascript.
11th Apr 2017, 6:18 PM
Mohammed Arshad
Mohammed Arshad  - avatar
0
Can u give me an example script for getting boolean input plz
12th Apr 2017, 5:41 AM
Mohammed Arshad
Mohammed Arshad  - avatar