×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: William Chalifoux
Added: Mar 17, 2021 7:15 PM
Views: 4787
Tags: no tags
  1. //making an arraylist
  2.         int size=5;
  3.         ArrayList name = new ArrayList(size);
  4. //adding things to arl
  5.         int q;
  6.        
  7.         for (q = 0; q < 6; q++) {
  8.         name.add(q, Variable1);    
  9.         }
  10.         System.out.println("The array tostring outputs this"+name.toString());
  11. //making an int out of an object of the al
  12.         int intVariable;
  13.         intVariable=(int) name.get(i);