Java Data Types: Short, Int & Long


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

question 1 of 3

What is the value of myNumber in the following code?

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. Consider a program that calculates distances between stars. What data type would be best suited for the variable that stores this number (e.g., distance)?

2. Which of the following is a valid declaration of an int data type?

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

There are different Java data types that exist. See what you know about these data types and their characteristics by using the worksheet and quiz.

Quiz & Worksheet Goals

The goal of these materials is to assess your understanding of:

  • A valid declaration of an int data type
  • Data type that is designed for the variable that stores distance
  • Characteristics of short, int, and long data
  • Saving long to an int
  • Value of data types

Skills Practiced

  • Reading comprehension - ensure that you draw the most important information from the lesson on integer types in Java
  • Knowledge application - use your knowledge to answer questions about data types
  • Information recall - access the knowledge you have gained about saving long to an int

Additional Learning

To learn more, use the lesson called, Java Data Types: Short, Int & Long. Use this lesson in order to:

  • Determine what declaring an integer involves
  • Review characteristics of long data types
  • Compare and contrast the different integer types