|
-
Efficiency question
All,
I am wondering if there is an efficiency to be had here:
{
Bank BankArray[] = new Bank[10];
//Get some data to be used in the bank classes
for(i=0;i<BankArray.Length;i++)
Bank[i] = new Bank(somedata0,data,somedata1,somedata2);
}
In the first line I have called the default constructor 10 times and then
later in the for loop call a different constructor ten times.
It seems like a waste but I'm new enough to the language that I think I
might have missed something,
is there anyway to populate the array with bank objects without the calling
new twice?
TIA
Greg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks