Popular Google Pages:
This article is regarding What is variable in a program?
Last updated on: 24th January 2017.
◕ What is variable in a program?
A variable is a piece of memory that we use to store information for our program.
We give a name to that piece of memory and this name is the name of that variable.
Each named piece of memory that we define can store only one particular type of data, such as integer, floating point etc.
For an example:
If we define a variable to store an integers like 12, then it can't store a value that is a decimal, like 1.2.
The type of data that each variable can store is fixed and the compiler can verify this.
Before using the variable we must specify its name and type in our declaration statement.
Here int is the type of the variable.
Name of the variable is flower.
Related Java articles:
■ What is Java? Where we can apply Java?
■ Why Java is a Machine Independent Program? What is Machine Independent Program?
■ Root Directory of Java
■ How to Compile and run a Java Program?
■ What is variable in a program?
■ What is identifier in Java?
Top of the page