Campbell Ritchie wrote: Don't do arithmetic with Math#random(). For everything except a double x such that 0.0 ≤ x < 1.0, use a Random object. By the way, your arithmetic won't compile because its result is a double not an int.
Thanks for pointing that out!
You got used to randrange()
that was more of a lucky copy-paste
But what I don't like about declaring variables in a constructor is that passed variables are potentially changed during the construction (example will be below). There also can be certain operations between assignments. Which would mean that I should just declare variables to default values and only then set them.
Anyway, what do you think of the following implementation? Does it make any sense? Or would it better to avoid it?
Also, if I understood correctly, method overloading doesn't exist either. That's sad