I don't understand different variables - static, non-static etc. I presume it is quite important and makes a difference, that is why I am asking for a newbish like explanation.
For me a variable is just something that holds some kind of data in it... What is the difference between them?
Summary of Variables (The Java™ Tutorials > Learning the Java Language > Language Basics)
That link explains it as well as anyone else could.
What do you not understand?
There isn't a more newbish explanation than the one in the tutorial you linked. Go through the tutorial exercises -- just reading isn't enough.
Static and non static are not variables, they are modifiers. The difference of them tends to be a bit difficult to explain explicitly, instead, I'll come back to it later, unless others get to it first.
Variables come in two types, primitives, and references. Primitives are things like int, long, short, double, and differ in how they are stored and the amount of memory they require(32 bit, 64 bit, etc)
References refer to something, usually an object such as a string, a scanner, or a list, the memory is allocated on the heap and the reference points to the object located on the heap.
Try googling "java ranch variable cups" and see if you find the post I'm thinking may be helpful. Also, please feel free to ask more specific questions.
This is what I was looking for. Simple, undestandable explanation. Now I get it. Thanks so much!! And sorry for such questions! :(hi):
Originally Posted by sunde887