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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
why is that?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Wow I wrote that comment three years ago, surprised to see a reply now. I learned to write it like that from my high school CS teacher, but generally speaking string addition with "+" is bad practice since it is space inefficient (Strings are immutable, so it creates a new string every time you add). It seems to be fine in this case, however, Character.toString(c) may be considered best practice. String.valueOf(c) should likely work as well.
Can I ask? Where did you get to learn how to use it like this? Cant seem to find a book that teaches methods.
Yes, I believe that c + "" would also result in a String and the code should run just fine. As for why I wrote it as "" + c is that it is more explicit in showing that I am appending a character onto a string. I guess it is also better practice because that was how I was taught to do it. :)
This comment is hidden because it contains spoiler information about the solution