Declaring Variables in Java


Choose an answer and hit 'next'. You will receive your score and answers at the end.

question 1 of 3

Which one of these is NOT a valid name for a Java variable?

Create Your Account To Take This Quiz

As a member, you'll also get unlimited access to over 79,000 lessons in math, English, science, history, and more. Plus, get practice tests, quizzes, and personalized coaching to help you succeed.

Try it risk-free
Try it risk-free for 30 days. Cancel anytime
Already registered? Log in here for access

1. What will be displayed when this Java code is executed?

2. To declare a constant, the Java keyword _____ is used.

Create your account to access this entire worksheet
A Premium account gives you access to all lesson, practice exams, quizzes & worksheets
Access to all video lessons
Quizzes, practice exams & worksheets
Certificate of Completion
Access to instructors
Create an account to get started Create Account

About This Quiz & Worksheet

Use these helpful study tools to discover how much you know about variable declaration in Java. Topics include valid names for a Java variable and the execution of a given Java code.

Quiz & Worksheet Goals

Worksheet/quiz goals will cover what's listed below:

  • The Java keyword to declare a constant
  • Variables with a value that doesn't change
  • The value assigned to a variable declared as a reference to a Java object

Skills Practiced

  • Reading comprehension - ensure that you draw the most important information from the related lesson on variable declaration in Java
  • Information recall - access the knowledge you've gained regarding a valid name for a Java variable
  • Making connections - use understanding of the concept of Java keywords and how they are connected to the value of variables

Additional Learning

For more on the subject, review the lesson named Declaring Variables in Java. The lesson will address the following areas of study in greater detail:

  • Declaring your intentions
  • Primitive data types
  • Declaring object reference types
  • Naming conventions