• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing collection to a file

 
Jd Hanson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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:
oos.writeObject(ccal.get(i));

Thanks for you help !




 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
get(int) is defined on List, not Collection. You can either pass in a List or change the implementation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic