I am tasked with converting some Python code to Java. I have some experience with Python, but am unfamiliar with some of its features.
I see an __init__ method which I understand is essentially a constructor.
I expect to see arguments like this:
def __init__(self,derp1, derp2, derp3):
But in one part of the code, I see:
def __init__(self,derp1=0, derp2=0, derp3=0):
Now, to me, it looks like this is some sort of conditional constructor, used specifically when (self,0,0,0) has been passed. This shouldn’t be the case, because there is no alternative constructor.
It also shouldn’t be an inline assignment, as that just doesn’t make sense.
I’ve tried Googling to figure out what this means, but I’m not having much luck.
I appreciate any help you can offer.
They’re Default Argument Values.
I think Java doesn’t support it.