Skip to content
Advertisement

Tag: conditional-operator

Ternary Operators Java [duplicate]

This question already has answers here: Ternary Operator (4 answers) Closed 5 months ago. Is there a way to implement this in a ternary operation. I’m very new to that ternary stuff, maybe you could guide me. This one doesn’t seem to work. Answer In this case, you don’t even need a ternary operator: Or, cleaner: Your version: is semantically

Check if int is between two numbers

Why can’t do you this if you try to find out whether an int is between to numbers: Instead of it, you’ll have to do which seems like a bit of overhead. Answer One problem is that a ternary relational construct would introduce serious parser problems: When you try to express a grammar with those productions using a typical PGS,

Advertisement