The question is simple personal: Can I have more than one constructor in the same class?
At first, I'll need to set the plugin
variable in my object, so I'll use the constructor that defines that variable;
public RankAPI(Main main) {
plugin = main;
}
However, in a second moment, I will need to define a second variable, the variable p
in my object, so I will have to use the second constructor:
public RankAPI(Player player) {
p = player;
}
Unfortunately, I can not define the two variables, since the p
variable will be defined by other programs when they need to access my API, and the plugin
variable will be defined by my own program when it is executed.
Thanks for your attention.