In the program, when the window is opened, the following objects are initialized: the parent and its heirs. At the parent during initialization, a certain field is filled, which is necessary for the work of the heirs.

  1. Is it possible to intercept the field at all, if it seems like the objects have already been initialized?
  2. How can I solve this problem? (P.S. I think there will be options with "output a block of code to a method" - yes, I tried to do this, but it does not work out right away (someone else's class)).
  • heir can override parent initialization method - Senior Pomidor
  • @SeniorPomidor, i.e. I can do to load the opposite first? But according to the load hierarchy, it will not happen the same way - a client is created -> and then a heir. Or is it that I can override the initialization methods in the children? - sank
  • P.S. the field to which I am referring can be made Static - then it is updated dynamically everywhere - because of this, it immediately works. But such an option seems crazy to me, with getters it transmits an initial (not initialized) value. - sank
  • Heirs have access to the fields (and everything else) declared protected and above, the task is not very clear - Maxim
  • @Maxim - look, the parent and the heir are initialized at the same time. Those. when an heir is initialized, I cannot capture the fields of the parent (the created object), since it happens at the same time. (I saw from the logs that objects appear first, and then the field I need is filled in). Actually the question of how to solve this without statics is beautiful. - sank

0