Write about the declaration of Variables in JAVA.
Advertisements
Question
Write about the declaration of Variables in JAVA.
Short Answer
Advertisements
Solution
In Java, declaration of variables refers to the process of specifying the data type and name of a variable before using it in a program. The data type determines the type of value that can be stored in the variable.
Syntax:
dataType variableName;
Example:
int age;
Here, int is the data type and age is the variable name. This statement declares a variable named age that can store integer values.
shaalaa.com
Is there an error in this question or solution?
