Massimo Caliman

### Categories

• Computer Science

• C#
• Java

### Languages

• English

In C# the ?? operator is called the null-coalescing operator. Here’s an example of use:

It returns the left-hand operand if it is not null, otherwise it returns the right-hand operand. A possible alternative in Java of C# ?? use ? , the ternary operator, like this:

Or, by using a method like this: