Variables and Data types
Droid :: Programming :: Java programming
Page 1 of 1
Variables and Data types
Variables are nothing but reserved memory
locations to store values. This means that
when you create a variable you reserve some
space in memory.
Based on the data type of a variable, the
operating system allocates memory and
decides what can be stored in the reserved
memory. Therefore, by assigning different
data types to variables, you can store integers,
decimals, or characters in these variables.
There are two data types available in Java:
Primitive Data Types
Reference/Object Data Types
Primitive Data Types
There are eight primitive data types supported
by Java. Primitive data types are predefined
by the language and named by a keyword. They are :
What Next
locations to store values. This means that
when you create a variable you reserve some
space in memory.
Based on the data type of a variable, the
operating system allocates memory and
decides what can be stored in the reserved
memory. Therefore, by assigning different
data types to variables, you can store integers,
decimals, or characters in these variables.
There are two data types available in Java:
Primitive Data Types
Reference/Object Data Types
Primitive Data Types
There are eight primitive data types supported
by Java. Primitive data types are predefined
by the language and named by a keyword. They are :
- byte
- int
- short
- float
- double
- long
- char
- boolean
What Next
This Tutorials explained what variables are. In our next post, we will learn our to use them in our java programs.
Sirex- moderator
- Posts : 4
Points : 31872
Reputation : 0
Join date : 2015-08-20
Droid :: Programming :: Java programming
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|