Let's pretend that
class MyObject { Object object1 = new Object(); Object object2; public MyObject() { object2 = new Object(); } public MyObject(Object object2) { this.object2 = object2; } public MyObject(Object object1, Object object2) { this.object1 = object1; this.object2 = object2; } }
When is object1 initialized? Before object2 , after object2 , depends?
What happens if I have a constructor that conflicts with the global definition of object1 , for example. in the third constructor above. What value does object take?
This does not cause me any problems, but I just wanted to understand the language a little. I like to know these little things so that I can later use them later.
source share