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.
nice approach
https://docs.oracle.com/javase/8/docs/api/java/util/List.html#toArray-T:A-
Why is 'new String[0]' passed in as parameter to the toArray method. What does it even mean? Thanks in advance.
Because at that point index
i+1
is same as string length.And exception is not thrown by substring unless index is greater than string length
Refer: https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#substring(int)
Can someone explain how when the i gets to the last letter (str.length -1) there is not an out of bounds exception caused by the str.substring(i+1) ?
Compare:
Personally, I find option 1 is more natural way to describe the alogrithm. YMMV.
Is the use of the keyword "continue" better than using brackets in this case?