Like jps said, you're taking the number of the last element in your string, and adding 1 to it. You can solve this by simply saying either:
for(int i = 0; i <= str.length() - 1; i++)
or the...
Type: Posts; User: Dragonalas
Like jps said, you're taking the number of the last element in your string, and adding 1 to it. You can solve this by simply saying either:
for(int i = 0; i <= str.length() - 1; i++)
or the...
First of all, you can't switch doubles. In Java, you can only switch whole numbers (i.e. int). When trying to switch a double or a float or even a String you'll get errors. You can solve this by...
Maybe you should think about this logically:
You need to count the amount of zeros, ones and twos in an array, and then find out which has the biggest count, correct?
Then I'll give you a...