If this object is String, Int, Char or etc...
and putting it to a file(Text File) you can use this
import java.io.*;
public class WriteTextFileExample{
public static void main(String[] args)throws IOException{
Writer output = null;
File file = new File("write.txt");
output = new BufferedWriter(new FileWriter(file));
output.write("Sample Text");
output.close();
}
}