106k views
5 votes
What is variable declaration in java ​

User Arminda
by
8.2k points

2 Answers

6 votes

Answer:

Great question!

A Variable declaration is just you creating a variable to hold your data.

Some of the different types of data type are doubles, int, strings

those hold certain type of data.

Step-by-step explanation:

An example is:

//I want to make a data that says Hi I am a computer programmer!

//Define the variable

String WhoIam = "Hi I am a computer programmer!";

//I want to output the variable

System.out.print(WhoIam);

//output

Hi I am a computer programmer!

Hope this helped!

User Christopher Smit
by
8.0k points
3 votes

Answer:

A variable declaration is a name given to a memory location. It is the basic unit of storage in a program.

User Alexandre Halm
by
7.8k points