0

Possible Duplicate:
Java “?” Operator for checking null - What is it? (Not Ternary!)
Java Null-pointer-safe accessor

Recently I read in one of the java forums about ?. operator. They wrote that ?. could not make it to the java 7. Can anybody explain what exactly ?. is?

Also, I like to know if this operator has any specific name or not like ?: is known as ternary operator.

Community
  • 1
  • 1
Priyank Doshi
  • 12,895
  • 18
  • 59
  • 82

2 Answers2

1

It's called the Null-safe operator.

helpermethod
  • 59,493
  • 71
  • 188
  • 276
1

I believe you mean the Null-safe operator, explained here. It was under consideration for Java 7, but subsequently dropped.

The other common use for the ? in Java is the ternary operator, which has been in Java since the dark ages and is explained here.

The two are completely different features however, the only common element is that they use the ? in some way.

Michael Berry
  • 70,193
  • 21
  • 157
  • 216