Hey folks.
I'm trying to make a new Fruit object each time aMethod is called.
The new Fruit object's name must be unique.
The problem is that the name of this Fruit object is the same name as one of the parameters of aMethod - this name is unfortunately the best name for the new object I think.
What can I do make it work?
Whatever the new Fruit object is called, the name must contain whatever is passed to aMethod.
Please help!
public void aMethod (String someFruit){
Fruit someFruit = new Fruit(someFruit);
}
//The Fruit object's name is the same name as the parameter.
//The parameter passed to Fruit is the String that's provided to this method (aMethod).