Search:

Type: Posts; User: Cornix

Search: Search took 0.08 seconds.

  1. Re: Why don't I get all the elements in my TreeSet?

    A set is usually not sorted (because thats not part of its definition) but perhaps there are some sorted set variations that I dont know of.
    The best solution would be to use a List if you need...
  2. Re: Why don't I get all the elements in my TreeSet?

    Because you call "next()" twice in your loop body.
    Everytime you call "next()" of an iterator you will get one additional element. If you have 10 elements you can call this method exactly 10 times....
Results 1 to 2 of 2