I am using a single switch cases which will have more than 100 cases statement to be used. Are there any limit ?
The usage of cases are for the suggestions of my Aut
When implementing switches many optimisations can be made for performance, otherwise you have to list through all the switches till it matches.
What I would do here, is have a main set of switches for the first character then nested switches inside, therefore if the choice was z it doesn't have to loop check every name first
switch(FIRSTCHAR){
case A: switch(index){
case 0: ..... break;
etc
}
break;
case B://do the same
}
Another way is to break your switch statement up into smaller equal sized statements. This is faster due the way the bytecode is compiled (ref Java performance tuning - shirazi)