» Tue Jun 18, 2013 6:59 am
To elaborate, it depends on the scope of the variable, the type of data stored in the variable (object or scalar / reference type or value type, etc.), and the language you're using. In most languages variables can have a lifetime of a single procedure call, the lifespan of a single object ("member variables" or "fields"), the lifespan of the process/application (often referred to as "globals" and should almost never be used), or the lifespan of a thread.
Value types like numeric values and (in many languages) strings and simple structures can actually be thought of as "stored" in the variable. Reference types like complex structures and those that also contain behaviors (classes) cannot be thought of that way. When you store an instance of a class, or object, in a variable you're actually only storing a reference to the object. The object itself is stored in a mechanism that's often called a "heap." This trips up a lot of developers that are new to object-oriented programming...some people have a difficult time understanding the difference between a reference to an object and an instance of an object.
One is not "better" than the other. They're different tools used for different purposes. If your purpose is to learn about programming without jumping headlong into arcane syntax and lower-level concepts like memory addresses and bitwise operations then I'd say that Java is the better of the two tools. Python is fun too. As others have mentioned, though, if you're trying to develop skills that translate into enterprise IT applications then Java is probably a better bet. I wouldn't agree that nobody uses Java outside of the enterprise, though. Most smartphone apps are developed on platforms that are at least derivatives of Java, and a ton of cross-platform open-source tools that I use personally are developed in Java. It's only the most-used language on the planet.
That said, I actually like C# better than Java. Don't tell anyone!
No offense, but neither of these statements make a lick of sense.