Computer Science, asked by namashya72, 2 months ago

How can we declare and initialise a variable in Java?​

Answers

Answered by lakshmanmaiti20
7

Answer:

To declare (create) a variable, you will specify the type, leave at least one space, then the name for the variable and end the line with a semicolon ( ; ). Java uses the keyword int for integer, double for a floating point number (a double precision number), and boolean for a Boolean value (true or false)

Explanation:

Answered by profdambaldor
2

Answer:

data_type variable_name = value;

Exmple Int  x = 5;

Explanation:

Similar questions