I have a class that's essentially like:
class Child extends Parent {
public void reinitialize() {
super(); // illegal
}
}
Basically, I want to call the constructor again to reinitialize. I can't refactor out the initialization code into its own method, because Parent is a library class I can't modify the source of.
Is there a way to do this?
initialize()method which does what your constructor currently does. Then, your constructor andreinitialize()should both simply callinitialize().this()). Vulcan: As mentioned, I cannot refactor due to not having the source forParent.