Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mormegil
on Dec 17, 2019
|
parent
|
context
|
favorite
| on:
Kotlin vs. Java
"? true :" is equivalent to just "||".
thomasahle
on Dec 17, 2019
[–]
And "X && Y || Z" is usually equivalent to "X ? Y : Z".
So "nullableVariable != null ? nullableVariable.someMethodCall() : fallbackIfNullMethodCall();".
twiceaday
on Dec 17, 2019
|
parent
[–]
If X is true and Y is false this returns Y instead of Z which is wrong.
Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: