How can I declare an object of a specific class in a new other class, and at the same time this object is an array?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can I declare an object of a specific class in a new other class, and at the same time this object is an array??

Using IDEAL Intellig

15th Nov 2020, 3:29 PM
Zahraa Doulani
Zahraa Doulani - avatar
2 Answers
15th Nov 2020, 8:16 PM
Avinesh
Avinesh - avatar
+ 1
Demo objArr[]=new Demo[10]; for(int i=0;i<objArr.length;i++) { objArr[i]=new Demo(); }
15th Nov 2020, 3:37 PM
Faisal Rahman
Faisal Rahman - avatar