I know I can call static methods inside a constructor.
-
I have one contructor in one class which is calling another constructor through
this(arguments). -
Secondly that second constructor is calling
super(arguments)calling super constructor.
I want to execute some code before these constructors execute. I cannot use a static block. Any ideas?
You can call static methods. I often do it like this:
Of course, we can’t call instance methods or use non static fields.
(and, of course, this pattern requires a constructor on super that takes parameters)