public class Exemplo002 { /** Cria uma nova instância de Exemplo002 */ public Exemplo002() { } /** * @param args os argumentos da linha de comando */ public static void main(String[] args) { // TODO código da lógica da aplicação aqui if (args.length != 2) { System.out.println("\nUso: java Exemplo002 origem destino\n"); System.out.println(args.length); System.exit(0); } URL url = new Exemplo002().getClass().getResource("."); File origem = new File(url.getPath() + args[0]); File destino = new File(url.getPath() + args[1]); Scanner s = null; try { s = new Scanner(new FileInputStream(origem)); while (s.hasNext()) { System.out.println(s.nextInt()); } } catch (FileNotFoundException ex) { ex.printStackTrace(); } finally { if (s != null) { s.close(); } } } }