0

can anyone explain "VARIABLES" in a simple way

the " VARIABLE " section in this app is kinda of understanding and confusing me a bit... Can anyone explain it in easy way ?!

14th Feb 2019, 7:14 AM
Pilli Revant Krishna Sagar
Pilli Revant Krishna Sagar - avatar
2 odpowiedzi
+ 3
You can think of a variable as a tiny box, with its name written in the side. It can store only one "thing" at a time, no more. For example, a variable can be of type int, thats an integer, so it can store (it depends on the machine, but lets use default for simplicity) values from -2million to +2million, just one number at a time Variables can be initialised, "overwritten" and can be of a lot of data types. Here are some examples: 1. (will use C-like language) int a = 25. Int the box you will have 25, now: a = 15 In the box, you no longer have 25, its gone forever, you have 15 Variables can be of a lot of data types: long int, short int, double, float, String, Array, boolean, char, and even user-defined data types. Also, each variable, when created, is placed somewhere in memory, at a certain ADRESS. Not that important to know for now, but useful.
14th Feb 2019, 7:28 AM
Demon
Demon - avatar
+ 1
hi Revanth Krishna can you clarify what language the variable you want explained is in?
14th Feb 2019, 7:16 AM
Ollie Q
Ollie Q - avatar