What are the values you want to save?
Perhaps one class can contain the data for each plant.
Then use a Map to hold the objects for each type of Plant.
The key would be the plant name and the...
Type: Posts; User: Norm
What are the values you want to save?
Perhaps one class can contain the data for each plant.
Then use a Map to hold the objects for each type of Plant.
The key would be the plant name and the...
That sounds like a macro or preprocessor activity. Java does not have that.
You will have to explicity code all your class definitions giving them each a unique name as you wish.
Class names in...
Your description of your problem is confusing.
What does "the object after plant" mean? Can you give an example
Does the plantList array contain tree objects? Is tree a class?
How does the...
Plant[] somePlants = new Plant[100]; // Create an array of Plant
...
somePlants[i] = new Plant(...); // put some Plant objects into the array
...
NewObj newObj = new NewObj(somePlants[y]); //...