I want to write a simple class to process Strings (may be very long strings up to 1mil characters in it). String will basically consists of two characters \"a\" and \"b\" that
What's wrong with using something simple as this? Your idea of doing something as simple as this is an overkill, and would end up using more resources.
String s = "abbb";
int a = 0;
int b = 0;
for(int i = 0; i