• Post Reply Bookmark Topic Watch Topic
  • New Topic

Returning java.util.Iterator

 
Ram Charan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Can I return Iterator in an EJB? 2) Generally speaking, it is a good practice to return iterator in a public API?

-Ram charan
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35743
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ram,
While you can return any Serializable object, why do you want to return an Iterator? It's easier to use an API that gives a Collection. I can get a local iterator on it if needed.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!