This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I have a class like this. Based on a certain value (which can change), I want to create objects. For eg.: if the value is 3, I want to create 3 objects for the below class. If the value is 10, I want to create 10 objects. The value is obtained from the first line of a file.
Please let me know how I can do this?
I want to get something like this, but dynamically:
I assume your question is not actually how to create the objects, you seem to know how to do that. It appears you don't know where to put them once you have created them. Well, you should put your created objects into an array, or a List.