Results 1 to 2 of 2
Thread: Comparing elements of an array
- 05-09-2011, 05:35 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 4
- Rep Power
- 0
Comparing elements of an array
We are to code two sets of integers (equal sizes) and find the union, intersect, and complement of the two sets.
I can't find anything in our text that deals with comparing elements of an array and displaying the results. I'm very new to working with arrays (very new to Java in fact). Where should I start with this problem?
Thanks for your help.
- 05-09-2011, 05:43 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
If 'a' is an array of ints then a[j] is an int (the j-th element of the array); j can be any other int used as an index in the array. Do you really have to work with arrays? Arrays are so 1960s Fortanesque ... have a look at ArrayLists or even Sets.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
Searching and comparing Array elements
By jmanswrd in forum New To JavaReplies: 5Last Post: 02-15-2011, 06:06 AM -
Trouble comparing Elements while using Generics
By ryuzog in forum New To JavaReplies: 13Last Post: 12-16-2010, 09:26 AM -
comparing elements in array
By garyscott101 in forum New To JavaReplies: 14Last Post: 12-10-2008, 03:01 PM -
comparing array elements
By Jeremy720 in forum New To JavaReplies: 2Last Post: 10-13-2008, 02:33 AM -
comparing array using character
By Anseki in forum New To JavaReplies: 7Last Post: 10-03-2008, 07:28 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks