Use ArrayList in java! | Sololearn: Learn to code for FREE!


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 .

6/27/2020 7:51:16 AM


8 Answers

New Answer


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());


great! it is ok! thanks


این سوال مربوط من هم بود 😂😂


it is a good way to slove our problem😁😁😁


Here, we can solve all assignments😂😂😂


Maybe, but it is to our detriment😒😒


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 😁


I don't know what was the problem ,i replied to your message,but he didn't go. i said i will lose challenge😂😂