0
Why are variables used in java
2 Antworten
+ 4
To store values according to the type of the values, for example, double or float: 2.45(number with decimal place), integer: 2(number without decimal place), boolean: true or false, character: a, b, , c,..., String: “Hello World!”
+ 3
variables also help to make the code easier to read. for example when you want to do something with the return value of several functions it's better to store them in variables than to write everything in one long line.