I am trying to understand the difference between the object and instance and in some forums it is mentioned as same and in other it is mentioned as different.
Q.1 If we instantiate 4 different objects with different properties of a class say
Class A(..)
A a1 = new A(..1..)
A a2 = new A(..2..)
A a3 = new A(..3..)
Then are a1, a2, a3 objects of A or instances of A , or we can say both. And is there a situation where there can be an object of A only or instance of A only ? if no, is there any specific reason why there are two different terms used?
Q2.
Class A(..)
A a1 = new A(..1..)
A a2 = a1
Here as a2 is referencing to a1, now is there any memory difference between a1 and a2.
say class A itself holds 24 bytes of memory
So if we create instance/object(need to confirm) in the second line. We will be having another 24 bytes of memory and additional reference memory for a1 right?. What would be that referenced memory size.
And we have another reference a2, now what will be the memory size for that a2 , is that also 24 bytes + its own referencing size or its just the reference size?
I have written in C# syntax.