Does anyone know how to add methods to an immutable class which allows me to modify the object specified upon initialization only?
For example you have 2 numbers which you want to be able to multiply by a factor.
so when initialising you want to also be able to multiply if you wish to
Class name_of_object = new class(int1, int2).multiply_method(intfactor);
and that would create an object which cannot be modified?