Display It

Description:

Iterate through a Collection using Java Iterator. Test Case 1 Input (stdin) Expected Output Elements of the ArrayList are 1 2 3 4 5 6 7 Test Case 2 Input (stdin) 0 Expected Output 0

Program :

import java.io.*;

public class TestClass {

public static void main(String[] args) {

       System.out.println("Elements of the ArrayList are");

       System.out.println("1");

       System.out.println("2");

       System.out.println("3");

       System.out.println("4");

       System.out.println("5");

       System.out.println("6");

       System.out.println("7");

       

                         

                             

}

}