to be honest with you, I really need someone to make me understand why the second one does not work. The constructor and the setter does nearly the same thing right? so why is it that the first one work and second one don't? please explain like I'm five.Thank you.
In the first sample code there is a conversion constructor that accepts an argument of the type int. The second sample code has no such constructor. Your function Add in the return statement has the expression of the type int which shall be converted to the type variables because you specified such return type. But there is no such constructor in the second sample code. So the compiler shall issue an error.