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.
Even better using
new StringBuilder(initialLength)
constructor since final string length is predictable to avoid memory copy when internal buffer is exhaustedthank you!
String string = "";
for (int i = 1; i <= num; i++) {
string += i + " sheep...";
}
This method creates a new String object each time "string += " is called, but only one object is referenced by the variable. The unused objects are stored until they get deleted at the end. StringBuilder remains one object the whole time and reduces RAM use.
Why is using stringBuilder considered best practice?
Yes, and I have now done exactly that.
I'm the original Kata author, but didn't write the Java translation, so it wasn't my fault, guv'nor :-)
The result should be long for tests in Java
no actual fixed tests either... (edge cases)
The author killed his own kata O_o
Fixed.
This is caused by the preloaded file having the same public class as the solution file. Java file names are inferred from the package declaration and the public class name so this results in file name conflict.
I need to remove "This error was caused due to an issue processing the web request, not because of an issue executing your code. You can retry the request." for 422 errors because trying it again won't help.
Never seen this in a Java kata before. Can't even run a simple string
return
test.