Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Concatenates text files and outputs the result to a file.
public class Cat
{
private Cat() { }
public static void main( String[] args )
{
Out out = new Out( args[ args.length - 1 ] );
for ( int i = 0; i < args.length - 1; i++ )
{
In in = new In( args[i] );
String s = in.readAll();
out.println(s);
in.close();
}
out.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment