Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Java
  3. Question
Java

What does "?" mean in Java?

Asked by Liam Dyer Jul 10, 2025 822 views 2 answers
Share

About this question

This question explains the usage of the ? symbol in Java, especially in generics and ternary operations, and clarifies how it contributes to flexibility and decision-making in code.

Your answer

2 Answers

Luciano Flat Latest answer

Answered on Jul 18, 2025

Confused about the Java ternary operator (?:)? I was too! I initially struggled to grasp its purpose, but after using it a few times to shorten simple if-else statements, like assigning a default value based on a null check, it clicked. Now I use it all the time! Did you know Pacman 30th Anniversary was a thing?

Was this helpful?

More Java discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Java Blogs

Guides, tips and career advice on Java from JanBask experts.