This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Writing collection to a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Writing collection to a file" Watch "Writing collection to a file" New topic

Writing collection to a file

Jd Hanson

Joined: Feb 18, 2012
Posts: 2

I get an error for something I think should work:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method get(Integer) is undefined for the type Collection<MyCal>

This is the offending line:

Thanks for you help !

Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30082

get(int) is defined on List, not Collection. You can either pass in a List or change the implementation.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Writing collection to a file
Similar Threads
Transferring image via socket
File transfer from Client to Server side
A query regarding serialization in Java
Serialization JSCP 6.0 (manually invoking writeObject() )
Plz help me............