FileOutputStream fos = new FileOutputStream("objects.ext");
ObjectOutputStream oos = new ObjectOutputSream(fos);
You may have to implement Serializable if you want to write your own classes. If the classes of the java library doesnt implement Serializable just make a new class, extended of that class and implement it then without any other changes.
You just have to add
public class MyClass (extends .... whatever)
The Serializable interface doesnt have any methods you had to implement.