Hey all, this is indeed a homework question (I read the policy.) But I've tried everything and searched the web for ideas or functions with no luck.
Anyways, the basic part that I'm stuck at is I'm unable to find a way to count a number of times a character is in a
string. like:
string blarg = "aabbccc"
counting the number of "b" would be 2
Now... the problem is
Java doesn't like Strings versus Arrays, (unlike C/C++ where they are the same thing and I wouldn't be asking this question.)
So I tried converting it into an array, which worked, but then I was unable to count it. ( I've tried split and string.toCharArray)
count wise, using for loop and length of array. That part is not what I'm asking....
Pretty much I'm trying to find a command/method where I can compare two values of two separate arrays.
equals ( arr1 , arr 2) didn't work for me...
the == doesn't work for objects....
Maybe I'm not making them as objects?
Some points or hints will be helpful.
Thanks-