i am new to java and i am try to use serializable. i am learning from examples in a book i have and i have typed in couple java files:
first one
Code:
import java.io.*;
import java.util.*;

public class StudentList implements Serializable {	
	
	//Vector holding out students
	
	ArrayList<String> list;
	
	//default constructor
	public StudentList() {
	}
	
	public void addStudent(String value) {
		//add a string representing a student name
		if ( value != null ) {
			list.add(value);
		}
	}
	
	public void listStudents() {
		//iterate over list vector, printint all Strings
		for ( int x = 0; x < list.size(); x++ ) {
			System.out.println("Student " + x + " : " + (String)list.get(x));
		}
	}
}
this one i have updated a little due to some of the original file being depreciated.
i was getting warnings when i would compile it.....
hopeing i did this correct
the original was as follows

Code:
import java.io.*;
import java.util.*;

public class StudentList implements Serializable {	
	
	//Vector holding out students
	Vector list = new Vector(6);
	
	//default constructor
	public StudentList() {
	}
	
	public void addStudent(String value) {
		//add a string representing a student name
		if ( value != null ) {
			list.addElement(value);
		}
	}
	
	public void listStudents() {
		//iterate over list vector, printint all Strings
		for ( int x = 0; x < list.size(); x++ ) {
			System.out.println("Student " + x + " : " + (String)list.elementAt(x));
		}
	}
}
the second one is as follows, not modified....
Code:
import java.io.*;


public class StudentListApplication {
	//Default Constructor
	public StudentListApplication() {
	
	}
	
	//adds student names to list
	public void buildStudentList(StudentList value) {
		value.addStudent("Bob Robinson");
		value.addStudent("Steve Bobinson");
		value.addStudent("Rob Stevinson");
		value.addStudent("Todd Thompson");
		value.addStudent("Tom Toddson");
		value.addStudent("Rob Bobinson");
	}
	
	// Stores the Serializable StudentList to the file "file.dat"
	public void putStudentList(StudentList value) {
		try {
			//create the ObjectOutputStream passing it the FileOutputStream 
			//object that points to our persistent storage.
			ObjectOutputStream os = new ObjectOutputStream( new FileOutputStream("file.dat"));
			//write the StudentList to the ObjectOutputStream
			os.writeObject(value);
			os.flush();
			os.close();
		}
		catch (IOException e) {
			System.err.println(e.getMessage());
		}
	}
	
	public StudentList getStudentList() {
		StudentList list = null;
		try {
			//create the ObjectInputStream passing it the FileInputStream object that points
			//to out persistent storage.
			ObjectInputStream is = new ObjectInputStream( new FileInputStream("file.dat"));
			//Read the stored object and downcast it back to a StudentList
			list = (StudentList)is.readObject();
			is.close();
		}
		catch (IOException e) {
			System.err.println(e.getMessage());
		}
		catch (ClassNotFoundException ce) {
			System.err.println(ce.getMessage());
		}
		return list;
	}
	
	public void invoke() {
	
		StudentList list = new StudentList();
		
		buildStudentList(list);
		
		System.out.println("Before being serialized.");
		list.listStudents();
		putStudentList(list);
		
		System.out.println("After being read back in.");
		//get the StudentList and print it out
		StudentList inList = getStudentList();
		if ( inList != null ) {
			inList.listStudents();
		}
		else {
			System.err.println("readObject failed.");
		}
		try {
			System.out.println("\n Press enter to quit.");
			System.in.read();
		}
		catch (Exception e) {
			System.err.println(e.getMessage());
		}
	}
	
	public static void main(String[] args) {
		StudentListApplication studentListApplication = new StudentListApplication();
		studentListApplication.invoke();
	}
}
the problem i have is when i try to compile the second one i get errors everywhere that the class StudentList is referenced...
errors are
StudentListApplication.java:11: cannot find symbol
symbol : class StudentList
location: class StudentListApplication
public void buildStudentList(StudentList value) {
^
StudentListApplication.java:21: cannot find symbol
symbol : class StudentList
location: class StudentListApplication
public void putStudentList(StudentList value) {
^
StudentListApplication.java:36: cannot find symbol
symbol : class StudentList
location: class StudentListApplication
public StudentList getStudentList() {
^
StudentListApplication.java:37: cannot find symbol
symbol : class StudentList
location: class StudentListApplication
StudentList list = null;
^
StudentListApplication.java:43: cannot find symbol
symbol : class StudentList
location: class StudentListApplication
list = (StudentList)is.readObject();
^
StudentListApplication.java:57: cannot find symbol
symbol : class StudentList
location: class StudentListApplication
StudentList list = new StudentList();
^
StudentListApplication.java:57: cannot find symbol
symbol : class StudentList
location: class StudentListApplication
StudentList list = new StudentList();
^
StudentListApplication.java:67: cannot find symbol
symbol : class StudentList
location: class StudentListApplication
StudentList inList = getStudentList();
^
8 errors

both java files and the StudentList.class are in the same directoy on my machine....

any help would be great, thanks mike.......