I'm looking at a piece of Java code that contains:
User rv = tmp != null && tmp.size() > 0 ? tmp.get(0) : null;
I'm not very strong with Java syntax. My interpretation is that rv = tmp as long as tmp is null tmp's size is > 0, or else it equals null. Am I correct?
User rv = (tmp != null && tmp.size() > 0) ? tmp.get(0) : null;