473,503 Members | 1,849 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

having trouble with finding and counting the unique numbers

1 New Member
hi guys, i am new to JAVA
I am having trouble with array, anyone can help?
here is the problem. if i input 10 numbers, how can i count the unique numbers and output them
here is the example:

Please enter 10 numbers, hitting return after each one:
15
5
10
5
15
80
10
15
15
50
You entered 5 unique numbers:
15 5 10 80 50
May 11 '10 #1
2 1704
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
Convert the array to set and then convert the set back to array.

Read this. Look at post #5

Regards
Dheeraj Joshi
May 11 '10 #2
jkmyoung
2,057 Recognized Expert Top Contributor
There's no real need to convert the set back to an array, unless it's in your requirements.
May 11 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
10723
by: August1 | last post by:
A handful of articles have been posted requesting information on how to use these functions in addition to the time() function as the seed to generate unique groups (sets) of numbers - each group...
0
931
by: movestuff | last post by:
I've just started digesting Yank's "Build your own DB-driven website using PHP & MySQL' as I'm trying to prepare a dynamicly updated interactive site for a charity which aims to link users to other...
4
1632
by: Megan | last post by:
Hi- I need some help/ advise on how to code unique numbers for the primary keys of my 2 tables. I inherited a database that covers information about Hearings and Rulings. Information about the...
0
1521
by: Jozef | last post by:
Hello, I'm having trouble with the download links on my web server. The error I'm getting is; CGI Timeout The specified CGI application exceeded the allowed time for processing. The server...
9
12558
by: dave m | last post by:
I need to be able to retrieve a unique ID from a users PC. I needs to be something a user could not easily change, like the computer name. Could someone point me in the right direction to find ...
2
1186
by: MLH | last post by:
I can't seem to find an A97 HELP blurb telling me how to make a specific Tab Page active from within VBA. I have a form with 3 tabs. They work great. I want to optionally make the first, second or...
2
1734
by: Jake Barnes | last post by:
I've read over the documentation for these effects: http://wiki.script.aculo.us/scriptaculous/show/CombinationEffectsDemo I want to include them on my page. I tried attaching using onload, but...
0
1835
by: harry12 | last post by:
Hello- I'm fairly new at using Microsoft Access and I'm having trouble getting a couple of things to work in my database. The first is that I have yet to find a way to get an append query to...
2
1498
by: Damas | last post by:
Hello, First of all please excuse my vocabulary, english isn't my mother tong. I'm having a hard time trying to do this. I have two tables in a MySQL db, first one is for members datas, second one...
2
2001
by: Stu | last post by:
Hi guys, I've been having trouble getting the clock function to work portably, please could I get some thoughts? <Possibly OT comments> It works fine on my laptop (under WinXP) and on my...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7006
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5592
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5021
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.