Computer Science, asked by LoknathDas31, 2 months ago

how to understand how many variables to be taken as input in java?​

Answers

Answered by sainikaur217
1

Answer:

Variables in Java

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

The value stored in a variable can be changed during program execution.

A variable is only a name given to a memory location, all the operations done on the variable effects that memory location.

In Java, all the variables must be declared before use.

How to declare variables?

We can declare variables in java as follows:

type: Type of data that can be stored in this variable.

name: Name given to the variable.

In this way, a name can only be given to a memory location. It can be assigned values in two ways:

Variable Initialization

Assigning value by taking input

How to initialize variables?

Similar questions