+ 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 .
8 Answers
+ 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());
+ 2
great!
it is ok!
thanks
+ 2
این سوال مربوط من هم بود 😂😂
+ 1
it is a good way to slove our problem😁😁😁
0
Here, we can solve all assignments😂😂😂
0
Maybe, but it is to our detriment😒😒
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 😁
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😂😂