+ 3
What is the basic difference between a object and a variable ?
PS... please explain a little bit about oops if you can
4 odpowiedzi
+ 8
A variable is nothing but a named stored location which holds known or an unknown value.
A variable can be initialized in a standard manner. The name variable is given, as a variable can be assigned any value; even const variables are initialized while declaration.
Object is just a fancy name given to user defined variables. Having said that, objects are a bit special. Objects are variables : but they are instances of user defined types called as classes or structures (structs).
https://www.quora.com/What-are-the-differences-between-a-variable-and-an-object-in-object-oriented-language
+ 2
a variable is a place to hold data.
an object has pre-defined values/functions attributed to it
+ 2
Simple variable can only hold one value (string, number, boolean etc).
Object can hold pairs of variables and values,
also that object model can be used for another object just different values, and oop is based on that, using same code multiple times with diff value s without rewriting it.
0
the two are containers _the major difference is that variable contain or carries value while object carries both variables and values