I\'m re-factoring some inherited code, but was stumped by the design decision and can\'t figure out the proper terms to google this. My predecessor would use blocks like thi
Your predecessor was still learning.
That's the best explanation you're likely to get. Perhaps at one point in time there was a need to have the code split up like this. It's hard to say. The code should certainly be written like this instead:
public class ChildClass extends ParentClass {
public ChildClass() {
inheritedVar = "someVal";
}
// rest of code
}
As for the initializer block, its purpose has been given by the other answers here. I threw my answer in as an attempt to answer the "why", which you requested. Unfortunately, for the real answer, you would have to ask your predecessor.