Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

comparing two arrays of integers.

Thread view: 
Nag - 23 Jun 2005 00:38 GMT
Hi,
I have two arrays of integers. i need to compare each element of one
array with each element of another array.
say..one master list, from 1 to 100 in one array.
and another list, from 20 to 40 in another array.
After comparision of two arrays, it should return a another arraylist
which should contain only 1 to 19 and 41 to 100.

how to do this?
Thanks for your inputs.
Wibble - 23 Jun 2005 03:34 GMT
> Hi,
> I have two arrays of integers. i need to compare each element of one
[quoted text clipped - 6 lines]
> how to do this?
> Thanks for your inputs.

Isn't school over yet?
Andrew Thompson - 23 Jun 2005 13:31 GMT
(snip description)

> how to do this?

If you are having trouble knowing 'where to begin',
check Patricia Shanahan's advice at..
<http://home.earthlink.net/~patricia_shanahan/beginner.html>

Note that a better group for those starting in Java is
'comp.lang.java.help'.

HTH

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

Nag - 23 Jun 2005 19:16 GMT
I should have used some java "techie" terms here...
any how, i got the solution..
I created two sets of data. and used following method:
set1.removeAll(set2)..
removeAll method removes from set1 all of its elements that are
contained in the specified collection (here set2)...


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.