+ 2

What is the difference between variable and object?

when I define a variable with a string-type.. is it considered an object of the class string? I mean are variable and object the same thing?

1st May 2018, 6:42 PM
Nahi Bul
Nahi Bul - avatar
1 Answer
+ 4
An Object is an instance of a Class, it is stored some where in memory. A reference is what is used to describe the pointer to the memory location where the Object resides. A variableis a means by which you can access that memory location within your application (its value is "variable").
1st May 2018, 6:50 PM
Mayank Rampuriya
Mayank Rampuriya - avatar