Advertisement
Fourteen98

array list

Sep 12th, 2021
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. package com.company;
  2. import java.lang.reflect.Array;
  3. import java.util.ArrayList;
  4.  
  5.  
  6.  
  7. public class Main {
  8.  
  9.     public static void main(String[] args) {
  10.  
  11.         ArrayList<String> Student =  new ArrayList<String>();
  12.  
  13.         Student.add("Kenneth");
  14.         Student.add("Nii");
  15.         Student.add("Samuel");
  16.         Student.add("Turf");
  17.  
  18.         for(int i = 0; i < 4; i++){
  19.  
  20.             System.out.println(Student.get(i));
  21.         }
  22.  
  23.  
  24.     }
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement