This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Get Programming with Java (MEAP only) and have Peggy Fisher on-line!
See this thread for details.
Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!

Alex Moradi

Greenhorn
+ Follow
since Jun 13, 2017
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
11
Given in last 30 days
9
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alex Moradi

Tnx to all for the answers.

I have an array with 5 elements.

I want to count repeated element, for e.g user input this set {1,1,1,2,3}

The program must say in your set
Number 1 repeated 3 times and ignor numbers that not repeated in the set!
I don’t want print 2,3! //is it okay till now!?

An other e.g user input this set:{2,2,0,4,4}
The out put should be :
2:2 , 4:2;
0 not repeated and no need to going print !
I don’t want to use hash table & map
Just using an array and loops.

I hope understand my mean.
Tnx alot🤨
3 weeks ago
Look,
1 repeated twice
2 repeated twice
3 repeated once
I wanna the output look like above
But i got that output:
1:2, 1,:2, 2:2, 2:2, 3:1

What change my code needs to get that output?
3 weeks ago
Hello everyone...
I'm trying to find repeated elements in array, and this is my code:


The question is i just wanna to show just repeated elements;
for e.g i enter this number {1,1,2,2,3}
the out put is:
Repeated numbers are:  1:2,  1:2,  2:2,  2:2,  3:1
i just want to show 1:2, 2:2, 3:1

what's solution?

tnx for your help...
3 weeks ago

Stephan van Hulst wrote:Your responses array has length 5, and you're trying to put result at index 5, which is the 6th element of the array. Recall that array indexing is zero-based.



hi,

this is my new code :



i can't enter more than 1 number and after that: ERROR :|
1 year ago
Hello everyone

I started learning JAVA with How to program JAVA( Detail & Detail ) E-book;

In one example the book told this Code:





and i want use input and get data from user, and and modified that like below:



when i compile this code i got an error, where is my mistake ?

tnx for your answer.
1 year ago