Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. import java.util.ArrayList;
  2.  
  3. public class ArrayListDemo {
  4.    public static void main(String[] args) {
  5.        
  6.     int a = 7;
  7.     int b = 4;
  8.     int c = 2;
  9.     int d = 81;
  10.     int e = 9;
  11.     int f = 11;
  12.     int g = 24;
  13.     int h = 16;
  14.    
  15.     ArrayList<Integer> list = new ArrayList<Integer>();
  16.  
  17.     list.add(a);
  18.     list.add(b);
  19.     list.add(c);
  20.     list.add(d);
  21.     list.add(e);
  22.     list.add(f);
  23.     list.add(g);
  24.     list.add(h);
  25.    
  26.     System.out.println(list);
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement