Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I vote clever but not best practice because of the using of RuntimeException.
In Java, a RuntimeException should not be checked but avert. That's the difference from its direct parent Exception with is checked.
It is not a big mistake, only a Java bad practice.
I give you these links if you want to check that by yourself :-)
You can see what I said in the introduction of the Exception javadoc : https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html
Again from the introduction of the RuntimeException javadoc : https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html
Very nice. I note the pop() using and the switch at the end of the while loop
I think you should have best perfs if you store
string.lower()
in a var and you replace it in your ternary by this var.With that, in very long strings, you don't have to call .lower() of your string for each character. You juste cast you string once.