In school my teacher taught us about objects and non static variables(in Java), and she explained that if we declare a non static global variable, say int a in a class and create an object obj of the class then we can use the object to access non static variable a by using the dot operator(obj.a).
Then she said that if we create another object(say, obj1) of the same class and access a from it using obj1.a1, then it will be independent of obj.a since obj and obj1 are different objects, hence obj.a and obj1.a have different memory locations.
My question is, does the system have a real memory location/address for the object? Like, is the memory allocation something like allocating an address to the object and storing various non static variables UNDER it(like the object's memory location is being partitioned to accommodate the different non static variables)? Or is the object just a hypothetical element, which is used to point to and access the various non static variables, which are the ones actually having REAL memory locations in the storage?
Tl;dr: Is the storage allocating a memory location for the object, or is it doing so only for non static variables under the object, and the object is a hypothetical element not having a real memory location in the storage?
I would really appreciate it if those who are answering this keep it a bit beginner friendly because I am just in 10th grade now.