Java Foundations — Question 2

Which statement is valid?

Answer options

Correct answer: C

Explanation

Option C is correct because it follows the proper syntax for variable declaration in most programming languages, using a valid identifier. The other options are incorrect due to invalid characters or formats: Option A starts with a digit, Option B uses an invalid character (–), and Option D has a space in the variable name.