Hello All!
I am studying for my
SCJP, and am a bit stumped on something simple. I understand the dot operator for the most part, but when one object reference uses it on another, I get a bit lost. Here is the code that I am having problems with:
a1.b1 = b2 //assume all of these references are to objects and that they have already been initialized and that they take no arguments. a1 refers to Class Alpha, and b1 and b2 refer to Class Beta.
So my question is, (to the kind person willing to help me), in what real world situation would I use this? It might help me understand what is going on to have a frame of reference. And when one object calls another like this, what is really happening? I understand a1.doSomething();, or a1.size = 14; but what does it mean to use the dot operator on another object reference? What is the logic? I am very confused here.
Thanks to everyone!
Matt