Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in read  RSS feed

 
rishman toor
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import java.io.*;
class ´┐ŻAAA^{
public static void main(String[] arg){
FileInputStream fi=new FileInputStream();
ObjectInputStream oi=new ObjectInputStream(fi);
while(!eof){
oi.writeObject(c1);
....
..
....
fi.close();
}
}
}

just reads first object and get exception class cast exception in main
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain your problem more clearly. In the source code you posted, there's nothing that reads an object.

Look at the exception message. It most likely includes a stack trace, that indicates exactly at which line in which source file the exception happened. Go to that location in your source file and find out what's happening.

Please copy and paste the exact error message (including stack trace) and your source code here in the forum, so that we can help you trace the problem.
 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This post is a continuation of this post. I'm going to close the previous post.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!