public class Serializacao {
public static void main(String[] args) throws IOException {
String nome = "Marcos Marmota";
String nome2 = "Marcos Delicia";
ObjectOutputStream obj1 = new ObjectOutputStream(new FileOutputStream("teste.bin"));
obj1.writeObject(nome);
obj1.close();
System.out.println(nome); } }