Yeah it's easy to do one at a time. Although this code prints to the console first, the file is written a fraction of a second later:



import java.io.*;

public class Prasanna {

/**
...