0
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;

public class Test17
{   
    public static void main(String[] args)    
    {    
        try    
        {       
             StudentInfo si = new StudentInfo("Mac",104,"9823222");
             FileOutputStream fos = new FileOutputStream("D:/student.ser");
             ObjectOutputStream oos = new ObjectOutputStream(fos);
             oos.WriteObject(si);   
             oos.close();
             fos.close();
        }  
        catch(Exception ex)
        {  
             ex.printStackTrace();
        }
    }
}
miselking
  • 3,043
  • 4
  • 28
  • 39

1 Answers1

2

Every time the compiler can not find a part of your code he throws the error "cannot find symbol" when compiling. This problem may occur, e.g. when (1) a class is accessed that is not imported, (2) a variable is used , which was previously not declared or (3) a method is called which does not exist.

In your case, I guess you have to import the StudentInfo class.

René Winkler
  • 6,508
  • 7
  • 42
  • 69