Skip to main content
PreparationZone Logo
PreparationZone
Back to Java

Java · Medium · Pro

Unnamed variables _ — where they clarify intent without noise?

JavaJava 22–25Senior
Model answerPreview

Unnamed variables

Use _ (unnamed) when a variable is required syntactically but unused—catch blocks, enhanced for, try-with-resources.