Can I have a constructor work in different ways if the argument is of different type? i.e. int or float.
Let's say that if I do, new Object(3) the constructor fills an array with 3 at every index
Let's say that if I do, new Object(3.5) the constructor fills an array with index+3.5 for every index
Let's say that if I do, new Object() the constructor fills an array with 0.0 at every index
Is there a way to achieve this with just one constructor? Or do I need three different constructors?
Thanks.