Use ArrayList in java! | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 2

Use ArrayList in java!

(Use ArrayList)Write a program that creates an ArrayList and add a loan object, a Date object, a String and a Circle object to the list, and use a loop to display all the elements in the list by invoking the object's toString() method .

27th Jun 2020, 7:51 AM
@Danishūüá¶ūüáę
@Danishūüá¶ūüáę - avatar
8 Respuestas
+ 3
Try this: //Create an ArrayList ArrayList<Object> list = new ArrayList<Object>(); //You have to create these classes.. list.add(new Loan()); list.add(new Date()); list.add(new String()); list.add(new Circle()); //And print.. for (Object obj : list) System.out.println(obj.toString());
27th Jun 2020, 8:07 AM
Blue!!
Blue!! - avatar
+ 2
great! it is ok! thanks
27th Jun 2020, 8:30 AM
Noria Soltani
Noria Soltani - avatar
+ 2
ōßŘĆŔÜ ō≥ŔąōßŔĄ ŔÖōĪō®Ŕąō∑ ŔÖŔÜ ŔáŔÖ ō®ŔąōĮ ūüėāūüėā
6th Jul 2020, 12:06 PM
‚ÄéMaryam Makhdoom
‚ÄéMaryam Makhdoom - avatar
+ 1
it is a good way to slove our problemūüėĀūüėĀūüėĀ
6th Jul 2020, 12:14 PM
Noria Soltani
Noria Soltani - avatar
0
Here, we can solve all assignmentsūüėāūüėāūüėā
6th Jul 2020, 12:12 PM
@Danishūüá¶ūüáę
@Danishūüá¶ūüáę - avatar
0
Maybe, but it is to our detrimentūüėíūüėí
6th Jul 2020, 12:14 PM
‚ÄéMaryam Makhdoom
‚ÄéMaryam Makhdoom - avatar
0
Perhaps it will be ,but after solving our questions we can make sure ourselves here by posting our questions . And I guess it's not our detriment even it's gainful for us because SOLOLEARN gives us XP too and also we will submit our assignment comfortably ūüėĀ
6th Jul 2020, 12:21 PM
@Danishūüá¶ūüáę
@Danishūüá¶ūüáę - avatar
0
I don't know what was the problem ,i replied to your message,but he didn't go. i said i will lose challengeūüėāūüėā
6th Jul 2020, 12:41 PM
‚ÄéMaryam Makhdoom
‚ÄéMaryam Makhdoom - avatar