• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Deleting duplicate integers from a vector!!!

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I'm going to post all of the code cos I know I'm really close to solving this problem now.
This code is ListDemo2.java, and this is basically the main progrm thats sets up all the applet stuff and displays the lists. What it can do is insert an item onto the end of the list, make an ordered list from zero up to an input in the text field(integer), make a random list, clear the list, delete duplicates ( this is what i'm having trouble with ) and exit the applet.

This code is called ListByVector.java and is used to generate the lists and then return the info back to ListDemo2.
 
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you looked at the Set API? HashSet doesn't allow duplicates to be added.
 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic