0
Can we consider the variables as objects of a class?
Can we consider the variables as objects of a class? If not, what is the difference between the two(variable and objet)?
2 Réponses
+ 7
A variable is a named value. A variable can have a primitive value (int, boolean, ...) or an Object reference (a reference to an Object). Or it can be null if it doesn't refer to an object. (Is "refer" a valid verb?)
+ 1
In most languages they are objects of a class. In particular, in Java, strings are objects, that's why they are called Strings with bis S. And by variables, I think you mean data types.