import java.util.*; class UseArrayLists11 // Shows reversing, and adding an integer after all occurrences // of an integer constructively in an ArrayList. Uses generic // static methods from a separate class. { public static void main(String[] args) throws Exception { Scanner input = new Scanner(System.in); System.out.println("Enter some numbers (all on one line, separated by spaces):"); String line = input.nextLine(); String[] numbers = line.split(" "); ArrayList a = new ArrayList(); for(int i=0; i b=ArrayListOps.constAddAfter(a,p,q); System.out.println("\nThe ArrayList created is "+b); System.out.println("The original ArrayList is still "+a); } }