• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Return Values

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wrote a method that in theory returns a TreeSet full of film titles. It was tested within its own calss and works. When I use the same method in my other class as you see at the bottom where set is TreeSet, I did the tests to print out the contents, and there is nothing. The variable method parameter comes from the main class and is a selection in a JComboBox.




 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Few questions, what's container defined as? Second, why do you use two iterators? If container is sorted this is ok, but if its not there's no guarentee the iterators are in the same ordering. For safety I tend to use one iterator and use the keySet() to retrieve the values such as:



As for your problem, there's not enough details to identify what is causing your results. Post more details.
reply
    Bookmark Topic Watch Topic
  • New Topic