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();
}
}
}
Asked
Active
Viewed 112 times
0

miselking
- 3,043
- 4
- 28
- 39

Kartik Raghuram
- 1
- 1
-
What is `StudentInfo`? Post trace please. – Maroun Mar 01 '15 at 12:36
-
I dont know. I have typed the prog as it is, as was given. It is giving me error on the StudentInfo line though. – Kartik Raghuram Mar 01 '15 at 12:40
1 Answers
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
-
Please can u do the edit of the prog and send me here plz im not getting it :( – Kartik Raghuram Mar 01 '15 at 12:53
-
Where do you have this example from? There has to be a StudentInfo class as well. – René Winkler Mar 01 '15 at 12:59
-
i tried to correct the prog but still error iam getting. so can u please correct it for me and send the final prog on here. – Kartik Raghuram Mar 01 '15 at 13:01