Trimming capacity of an ArrayList to current size of the given ArrayList

 

import java.util.*;

public class TrimToSizeArrayList {

public static void main(String[] args) {
ArrayList<String> al = new ArrayList<>();
al.add("Ajay");
al.add("Vijay");
al.add("Krishna");
al.add("Kiyan");
al.add("Nishu");
//this method will trim the capacity of array list
//to the current size of the given Array
al.trimToSize();

Iterator itr = list.iterator();
while (itr.hasNext()) {
System.out.println(itr.next() + " ");
}
}
}

Google Script for Data Entry Form in Google Spreadsheet

// function to validate the entry made by user in user form function validateEntry (){ // declare a variable and referernece of active goog...