I have a Java textbook example that is confusing to me because the 3 parameters in a called method have their names inexplicably changed when the method is created, and I can't figure out why. The specifics are as follows:
A reference variable named entity has been instantiated in the main method like this: Growth entity = new Growth();
Then it is initialized in the main method like this: entity.initialize(startSize, endSize, fractionGrowthRate);
All 3 of those parameter names exactly match variable names initialized just below the main method heading. Then here's where I start to be confused. In the driven class Growth (where the initialize method is made), the "initialize" method looks like this:
//************************************************** **
public void initialize(double start, double end, double factor
{
this.startSize = start;
this.endSize = end;
this fractionGrowthRate = factor;
} // end initialize
//************************************************** **
So why did they convert the parameter names?
Further confusing me is the fact that those same named 3 variables are declared just below the Growth class heading like this:
private double startSize; // initial size
private double endSize; // maximum size
private double fractionGrowthrate; // per unit size
Why convert those names when "start", "end", and "factor" never again appear anywhere else in the program?