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 did
This comment is hidden because it contains spoiler information about the solution
It's not boolean but Boolean ... so some items might be
null
. When you doif(arrayOfSheeps[i])
Java evaluates it asif(arrayOfSheeps[i].booleanValue()
but becausearrayOfSheeps[i]
is null you get the null pointerNice demonstration that interfaces, despite a popular belief to the contrary, can have methods with code (i.e. not just abstract methods) :)
Sorry but is a great example of how to complicate things unnecessarily:
input.split("")
is not necessary; you can already iterate through any string usingString.chatAt
else
is also unnecessary;This comment is hidden because it contains spoiler information about the solution