This site requires JavaScript, please enable it in your browser!
Greenfoot back
Evstar14
Evstar14 wrote ...

2020/5/4

Is there any symbol for "or"?

Evstar14 Evstar14

2020/5/4

#
I would like to know if there is a symbol which means "or", like "&&" means "and". I would like to use it in if statements such as:
1
2
3
4
if (variable1 == 1 OR variable2 == 1)
{
    doSomething()
}
Is that possible, or would I just have to use 2 if statements: 1 for each condition? Thanks!
Kostya20052011 Kostya20052011

2020/5/4

#
||
Evstar14 Evstar14

2020/5/4

#
Thanks! :)
Kostya20052011 Kostya20052011

2020/5/4

#
Welcome)
You need to login to post a reply.