Saturday, 21 October 2017

JAVA- Variables.

Variables

The intboolean, and char are fundamental data types of Java that we will see again later in the blog.
Another important feature of Java (and of many programming languages) is the ability to store values using variables.
  1. 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 myNumber = 7;
The variable myNumber 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 the blog.
Share:

0 comments:

Post a Comment