As the title said, how to do it in JAVA?

For example,

```
String example="Hello?";

```

The string contains `?` at the end, I need to detect it using JAVA.

Edit I need to detect all punctuation marks, not only `?`.