package iterator; public class Client { static int mode; List<String> fLines = Client.GetList(); for (Iterator<String> iter = fLines.iterator(); iter.hasNext();) { } } List<String> res = null; if (mode > 0) { res = new FileLineListOpt(FILENAME); } else { res = new FileLineList(FILENAME); } return res; } }