Learn
Introduction to Java
Data Types I: int
Great job! You’ve already learned how to print text.
Creating more useful Java programs will likely require you to work with several additional types of data. Let’s explore a few of them.
The first data type we will use is int
.
int
is short for integer, which are all positive and negative numbers, including zero. This number could represent the number of visits a website has received or the number of programming languages you know.- The
int
data type only allows values between -2,147,483,648 and 2,147,483,647.
Instructions
1.
Type any whole number in between the parentheses of System.out.println();
int
data types do not need to be typed within quotes, so you can avoid using quotes this time.