File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
author & internet detective

Joined: May 26, 2003
Posts: 33129

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

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Writing collection to a file
It's not a secret anymore!