import java.util.*; class UseTransformers4 { public static void main(String[] args) throws Exception { Scanner input = new Scanner(System.in); System.out.println("Enter some words (all on one line, separated by spaces):"); String line = input.nextLine(); String[] words = line.split(" "); ArrayList a = new ArrayList(); for(int i=0; i numberer = new NumberAdder(); ArrayList b=Transformers.applyConst(numberer,a); System.out.println("Numbering the words gives: "+b); ((NumberAdder) numberer).reset(); System.out.println("Enter some more words (all on one line, separated by spaces):"); line = input.nextLine(); words = line.split(" "); ArrayList c = new ArrayList(); for(int i=0; i d=Transformers.applyConst(numberer,c); System.out.println("Numbering these words gives: "+d); } }