Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Returning java.util.Iterator  RSS feed

 
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
Sheriff
Posts: 36393
453
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!