java program to write into a text file