Write a program that concatenates the contents of several files into one file. For example,

java CatFiles chapter1.txt chapter2.txt chapter3.txt book.txt

makes a long file, book.txt, that contains the contents of the files chapter1.txt, chapter2.txt, and chapter3.txt. The output file is always the last file specified on the command line.

Complete the following file:

CatFiles.java

import java.io.FileNotFoundException; import java.io.File; import java.io.PrintWriter; import java.util.Scanner; /** This program concatenates contents of several files into one file. */ public class CatFiles { public static void main(String[] args) throws FileNotFoundException { if (args.length < 2) { System.out.println("Usage: CatFiles sourcefile1 sourcefile2 . . . targetfile"); return; } String target = args[...]; . . . for (int i = 0; i < ...; i++) { String source = args[...]; . . . } . . . } }