You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
have access to post topics
communicate privately with other members (PM)
not see advertisements between posts
have the possibility to earn one of our surprises if you are an active member
access many other special features that will be introduced later.
1) read the array and have method available for searching the array
a) if a number matches any other number
- mark it for non-printable
- increase the counter
2) Output the printable number and the counter
I suspect there are quite a few classes you may be able to use for your operations if the specifications of your program are not limited to just a regular array. ArrayList comes to mind.
You can use the Set (HashSet) class to remove the duplicate items in the array.
1. Create an array
2. Convert it to a List
3. Create a Set from the List
4. When you get the set, convert it back to array.
After the step you'll have the duplicate element removed from the list.
__________________
Website: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. - Blog: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.