Stephan van Hulst wrote:When you get an exception that you don't know how to deal with, always copy it so people know what's going wrong.
Stephan van Hulst wrote:
it's likely that the modulus operator isn't defined for floating point operands.
Stephan van Hulst wrote:The second link is full of mistakes (for instance, you can have parameterless constructors that are not the default constructor, and constructors are not special types of methods) and also doesn't define the term "copy constructor".
It doesn't matter. In Java, you can write constructors that copy an object. Any comparison with how a language like C++ does it is meaningless.
Stephan van Hulst wrote:To have any meaningful discussion about this topic, you have to define what the term "copy constructor" means. My definition is a constructor that makes a copy of an object. According to that definition, you can create copy constructors in java. Does any other definition really matter? The outcome and use cases are the same.