Loading…
Loading…
Ten exam-style questions on legal identifiers, declaring several variables in one statement, definite assignment of local variables, default values for fields, final variables and every rule of var, with explanations.
Practice questions for the article Declaring and Initializing Java Variables: Identifiers, Defaults and var.
The questions follow Java 21 rules, as on the 1Z0-830 exam, unless a question says otherwise. Aim for at least 8 out of 10 before moving on.
Quiz path: step 6. Take the quizzes in this order, after reading each article.
Previous quiz: Primitive Types, Literals, Wrapper Classes and Text Blocks (OCP 21)
10 questions · pass at 68%
Check your understanding; you see the answers and explanations after submitting.
Discussion
Sign in to ask a question or share what you learned.