I am a python coder but recently started a forey into Java. I am trying to understand a specific piece of code but am running into difficulties which I believe are associated with not knowing Java too well, yet.
Something that stood out to me is that sometimes inside class definitions methods are called twice. I am wondering why that is? For example:
The following code is taken from a file called ApplicationCreator.java. I noticed that the public class ApplicationCreator essentially instantiates itself twice, or am I missing something here?
public class ApplicationCreator<MR> implements
IResourceObjectCreator<BinaryRuleSet<MR>> {
private String type;
public ApplicationCreator() {
this("rule.application");
}
public ApplicationCreator(String type) {
this.type = type;
}
So here my questions:
1) Why would the class instantiate itself inside the class?
2) Why would it do so twice? Or is this a way to set certain parameters of the ApplicationCreator class to new values?
Any advice would be highly appreciated.