1493 Views
The size() method to define that how many times the loop should run. The looping through the principle of an ArrayList with a for loop
public class Main {
public static void main(String[] args) {
ArrayList<String> mobiles = new ArrayList<String>();
mobiles.add("Samsung");
...
Anamika Gupta
Dec 15, 2021