This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Class obj1 = new Class() In above statement obj1 is object reference. If number of such object references needed at run-time is not known at compile time, how would you come up with next object reference e.g. obj2? In other words, can you put a function call in place of obj1 that return new name. I know you can use arrays but they are also fixed length. I have little knowledge that there are some container that adjust their size at run-type. Any other idea? Thanks Barkat Mardhani
Barkat Check out the Vector and the ArrayList classes. They are both resizable collections. so you could generate a number of object references at run time with out knowing in advance how many you were going to need. Of course, in many cases, you can do this with an array too, you just dont declare the array until you know how big it is going to be.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com