is there a Java equivalent to null coalescing operator (??) in C#? [duplicate] by IT Nursery Is it possible to do something similar to the following code in Java int y = x ?? -1; More about ?? 6 Answers 6