i wrote this method and then call it in main class, it actually print success but when i open the file and nothing in it. Further, when i read the file and print out all the