is there a Java equivalent to null coalescing operator (??) in C#? [duplicate] May 29, 2022 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