java code and output.txt