I would like to be able to modify the value of a local variable defined in a constructor within the class via the main driver class at some point while running the program. How would I be able to achieve this?
Here is a sample of a constructor that I am using.
public Scale()
{
weight = 0;
unit = "kg";
}
I'd like to modify the value of weight at a point while running the program in the driver.