i'm new to Java so i have a little problem... hope you could help me :)
i've read names from a file into vector and sorted them so i have like this in vector now
how can i count which name is most repeated?
in this case it would be Mario 5... i just need a number
thx a lot.
hope you understand everything 'cause my english is not very good :)
Welcome to the Java Forums!
Have a looksee at the API regarding Vectors, if you haven't already... you can probably use one or a combination of the methods available for your task. Post you attempted code when you get stuck.
Worse case scenario, you could probably iterate through the list of elements while comparing each element and using a counter at the same time.
See you around!
thx,i solve the problem...
i used if(vector.get(i)!=vector.get(i+1)) instead of if(!vector.get(i).equals(vector.get(i+1)) and that was problem...
later i tried with if(!vector.get(i).equals(vector.get(i+1)) and it worked fine...
but thx for help!
see you around! :)
Great to see that you solved your problem.