|
-
August 9th, 1999, 05:25 AM
#1
How can I create an array of object?
I have got a class. I want to create an array of object for that class holding 100 elements.
Zulfi
-
August 9th, 1999, 06:18 AM
#2
Re: How can I create an array of object?
try this code
Let your class Name is MyClass
MyClass myClass[];
myClass = new myClass[100];
-
August 11th, 1999, 09:37 AM
#3
Re: How can I create an array of object?
hai,
If U want to create an array of String objects, U do it like this...
String stringArray[] = new String[100];
This creates a 100 element array of objects belonging to the class String
Similarly, if U want to create an array of 100 objects of class YourClass, U do it like this...
YourClass yourClassObjects[] = new YourClass[100];
thanx,
devi prasad
[email protected]
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
|
Click Here to Expand Forum to Full Width
|