0

Write a java statement to declare and initialize a boolean variable with any legal value

Java

14th Feb 2021, 7:08 PM
Sahil Gupta
Sahil Gupta - avatar
4 Respuestas
+ 2
Sahil Gupta a boolean variable stores only true or false values. to correct your effort your statement would look like this boolean b= 1>6?true:false;
14th Feb 2021, 8:29 PM
D_Stark
D_Stark - avatar
0
Hi! First of all we want to see your attempt in this question.
14th Feb 2021, 7:14 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
boolean a=if(1>6); is this correct ?
14th Feb 2021, 7:15 PM
Sahil Gupta
Sahil Gupta - avatar
0
boolean b=false;
20th Feb 2021, 5:05 PM
Sahil Gupta
Sahil Gupta - avatar