This was a problem involving an array of chars and uses recursion. I understand partly how to solve it, but I can't seem to output how many times the char a
appears in the char array. Here is the method that I came up with two variations I tried but to no success.
private static Int charCount(char[] test, int i, char c) {
int[] number = new int[26];
char c = 'a';
if (test.length == 0) {
return 0;
}
int count = 0;
if (test == a) {
count++;
}
return count + count(test[1], a);
}
for(c = 'a'; c <= 'z'; c++)
{
for( char x : test )
{
if( c == x )
{
c++;
}
}
}