So far from I have been searching through the net, the statement always have if and else condition such as a ? b : c. I would like to know whether the if ternary statement can be used without else. Assuming i have the following code, i wish to close the PreparedStatement if it is not null (I am using
Tag: ternary-operator
What is the Java ?: operator called and what does it do?
I have been working with Java a couple of years, but up until recently I haven’t run across this construct: This is probably a very simple question, but can someone explain it? How do I read it? I am pretty sure I know how it works. if isHere is true, getHereCount() is called, if isHere is false getAwayCount() is called.