Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #2827

Re: How to remove duplicate values in an array.

X-Received by 10.66.189.163 with SMTP id gj3mr86743pac.32.1382569081316; Wed, 23 Oct 2013 15:58:01 -0700 (PDT)
X-Received by 10.50.73.4 with SMTP id h4mr137518igv.13.1382569081066; Wed, 23 Oct 2013 15:58:01 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!y3no80090258pbx.0!news-out.google.com!rn2ni120092pbc.1!nntp.google.com!i2no30225617qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.help
Date Wed, 23 Oct 2013 15:58:00 -0700 (PDT)
In-Reply-To <pgsb691cp899c3chl2llioj58luh7nu17r@4ax.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.129; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T
NNTP-Posting-Host 69.28.149.129
References <ca6512ad-67f1-43e1-8aea-a8a7b5641872@googlegroups.com> <pgsb691cp899c3chl2llioj58luh7nu17r@4ax.com>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <5db27a04-a306-4201-8aaf-018939535807@googlegroups.com> (permalink)
Subject Re: How to remove duplicate values in an array.
From Lew <lewbloch@gmail.com>
Injection-Date Wed, 23 Oct 2013 22:58:01 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.java.help:2827

Show key headers only | View raw


Roedy Green wrote:
> miss.smileyfish@... wrote, quoted or indirectly quoted someone who said :
> >I have some code to build an object elementData that stores a list of ints =
> >in an array and also keeps track of a boolean unique that determines if dup=
> >licates are allowed in a list. I have written a small method to search out =
> >duplicates and remove them, but for some reason it is not working. I am not=
> > sure if the problem is with the method itself or the placement of the call=
> > to the removeDuplicates method.
> 
> The lazy way to do this is it use an ArrayList which has a method for
> removing.

Even lazier is to insert them into a Set.

--  
Lew

Back to comp.lang.java.help | Previous | NextPrevious in thread | Find similar


Thread

How to remove duplicate values in an array. miss.smileyfish@gmail.com - 2013-10-12 22:18 -0700
  Re: How to remove duplicate values in an array. Steven Simpson <ss@domain.invalid> - 2013-10-13 10:00 +0100
  Re: How to remove duplicate values in an array. Joerg Meier <joergmmeier@arcor.de> - 2013-10-13 12:09 +0200
  Re: How to remove duplicate values in an array. Roedy Green <see_website@mindprod.com.invalid> - 2013-10-21 20:34 -0700
    Re: How to remove duplicate values in an array. Lew <lewbloch@gmail.com> - 2013-10-23 15:58 -0700

csiph-web