Can someone tell me what the ? and : operators do? I can't find a reference to them.
Sunetra Saha
Ranch Hand
Joined: Feb 25, 2001
Posts: 77
posted
0
they make up a consolidated if-else syntax. You can write the following if statement if(condA) { statementA; }else statementB; as condA?statementA:statementB
Kaspar Dahlqvist
Ranch Hand
Joined: Jun 18, 2001
Posts: 128
posted
0
Hi! Actually, the ? : is called the Conditional Operator. Some code to illustrate what Sunetra wrote:
Hope this helps! //Kaspar
Gaia Nathan
Ranch Hand
Joined: Aug 01, 2001
Posts: 62
posted
0
Thanks Sunetra, Kaspar. Both your replies made it very clear for me.