Multiple choice

Which of the following variable names follows proper Java naming conventions?

  1. another_variable_name

  2. Int

  3. myIdentifier

  4. variabletrackinghowmanyuserslogin

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Java variable names should follow lowerCamelCase, starting with a lowercase letter and capitalizing the first letter of each subsequent word. 'myIdentifier' is the correct choice, whereas 'another_variable_name' uses snake_case and 'Int' starts with an uppercase letter.