Problem writing a file!
I am using NetBeans 5
I want to save this class...
package castlesiege;
import java.util.*;
import java.io.*;
publicclass PlayerVectorextends Vectorimplements Serializable{
staticfinallong serialVersionUID = -2767605614048989439;
public PlayerVector(){
super(30);
}
}
using this class... (this is just a test, the real code will be slightly less stupid)
package castlesiege;
import java.io.*;
publicclass Save{
public ObjectOutputStream outputMeans;
public File file =new File("file");
public Save(){
PlayerVector veky =new PlayerVector();
veky.add(new Player());
try{
outputMeans =new ObjectOutputStream(new FileOutputStream(file));
outputMeans.writeObject(veky);
outputMeans.flush();
outputMeans.close();
System.out.println("Complete");
}
catch(IOException ioException){
System.out.print("io");
ioException.printStackTrace();
}
}
publicstaticvoid main(String args[]){
Save x =new Save();
}
}
I just want to store one vector with lots of different players' data using a very simple technique. And it worked perfectly outside of NetBeans and without the package declaration. But now I get an IOException which is born from a NotSerializableException (I think, I read up the tree). What did I do wrong?

