Create array of objects for Class

August 24, 2011 at 04:16:03
Specs: Windows 7
I have a class "Account". I want to create a array Object like

Account a[10];//means i need 10 objects..

How???

I tried like

Account[] a=new Account[10];

In this, i cant able to access the methods of Account class using the object a.


See More: Create array of objects for Class

Report •

#1
August 24, 2011 at 04:41:14
Which programming language are you using?

Report •

#2
August 24, 2011 at 05:04:14
You should be able to use expressions such as:

a[3].method()

to access methods. a.method() won't work because a is an array, not an Account.

What code are you trying to use that isn't working?


Report •
Related Solutions


Ask Question