Re: Continuin to fail at Java
That seems a bit redundant, that way I'd need a StringBuffer in my for-loop.
I checked the StringBuffer and it doesn't have a method that checks all substrings of a given length existing in the String, which is what I made with the for-loop.
Nevertheless, I'm only a starter at Java with my "less than half a year of class"-experience (first year only had one trimester Java). If I'm overlooking something important, do tell ;)
Edit: I get the idea that "you can better do it the right way the first time, as in the future you may come across problems if you do it this way", but I approach every problem differently and learn experimentally.
That seems a bit redundant, that way I'd need a StringBuffer in my for-loop.
I checked the StringBuffer and it doesn't have a method that checks all substrings of a given length existing in the String, which is what I made with the for-loop.
Nevertheless, I'm only a starter at Java with my "less than half a year of class"-experience (first year only had one trimester Java). If I'm overlooking something important, do tell ;)
Edit: I get the idea that "you can better do it the right way the first time, as in the future you may come across problems if you do it this way", but I approach every problem differently and learn experimentally.


Comment