Introduction to Java


The int, boolean, and char are fundamental data types of Java that we will see again later in the course.

Another important feature of Java (and of many programming languages) is the ability to store values using variables.

  1. A variable stores a value.

  2. In Java, all variables must have a specified data type.

We can assign a variable to a specified data type, like this:

int myLuckyNumber = 7;

The variable myLuckyNumber now stores the value 7 as an int type.

A semicolon ; is also used to end all Java single code statements. We will cover statements that should not end in a semicolon later in this course.

Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.