Search:

Type: Posts; User: Norm

Search: Search took 0.15 seconds.

  1. Replies
    10
    Views
    1,661

    Re: Using a string when creating an object.

    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...
  2. Replies
    10
    Views
    1,661

    Re: Using a string when creating an object.

    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...
  3. Replies
    10
    Views
    1,661

    Re: Using a string when creating an object.

    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...
  4. Replies
    10
    Views
    1,661

    Re: Using a string when creating an object.

    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]); //...
Results 1 to 4 of 4