Posted by
Zhullyblog
on
- Get link
- X
- Other Apps
A variable is container that stores data , text or numbers. A variable must have a name and also data assigned to it.
SYNTAX
Check this
int x = 5 ;
Int -- is a data type
X -- variable name
= -- assignments operator
5 -- value
The best way to declare a variable is simply by declare the data type, state the variable name and then assign a value to it. We would discuss more on data types.
Here are some important things you should know when declaring a variable.
They are :
• Variable names are case sensitive in Java
• Variable names must not have whitespace, something like this -- int num
Other examples are :
String firstName;
Boolean isTall = True;
Int a , b , c ;
Let's move
pleasese share
Comments
Post a Comment