Results 1 to 1 of 1
Thread: TreeSet & Displaying
- 11-14-2011, 03:59 AM #1Member
- Join Date
- Nov 2011
- Rep Power
TreeSet & Displaying
Hello fellow Java coders,
So I have a TreeSet with 5000000 phone number strings and I want to display the first, middle, and last strings. How can I go about doing that? I tried using a counter and iterator but the display doesn't seem to be right because the output of the last phone number should be the largest and it never is.
this is the conditional statement in my while (tree.hasNext()) loop that I'm not able to figure out what the problem is.
if (cnt = 1 || ... ) System.out.print tree.next(), repeat for 2500000 and 5000000.
Help very much appreciated!
Last edited by johnnychwu; 11-14-2011 at 04:05 AM.
- By samaravadhi in forum New To JavaReplies: 6Last Post: 09-07-2011, 03:59 PM
- By Bulska in forum New To JavaReplies: 3Last Post: 03-18-2011, 04:29 PM
- By Riftara in forum New To JavaReplies: 1Last Post: 10-21-2010, 08:33 PM
- By Java Tip in forum java.langReplies: 0Last Post: 04-15-2008, 07:34 PM