Can two string or char type value be checked in the condition of do-while?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can two string or char type value be checked in the condition of do-while??

can it be written in the way mentioned below??? do { ____ }while (variable1.equalsIgnoreCase(variable2);

30th Jun 2017, 1:25 PM
Anni Ananya
Anni Ananya - avatar
3 Answers
+ 2
why not
30th Jun 2017, 1:28 PM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 2
Yea, anything that's a boolean can (must) be written in the condition. Although in your example you forgot a round bracket before the semi-colon, so what you wrote wouldn't work. Fix/ ... variable2));
30th Jun 2017, 5:30 PM
Rrestoring faith
Rrestoring faith - avatar
0
it can be checked. try it
30th Jun 2017, 1:56 PM
Rohan Vijayvergiya
Rohan Vijayvergiya - avatar