I have got a class. I want to create an array of object for that class holding 100 elements.
Zulfi
Printable View
I have got a class. I want to create an array of object for that class holding 100 elements.
Zulfi
try this code
Let your class Name is MyClass
MyClass myClass[];
myClass = new myClass[100];
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]