While working on a school project, I wrote the following code:
FileOutputStream fos; ObjectOutputStream oos; try { fos = new FileOutputStream(file);
You're doing it right. It bothers the crap out of me too. You should initialize those streams to null explicitly - it's common convention. All you can do is join the club and want for using.
using