StringHelper class

  • 5
  • unavailable
We love static methods. They make the inaccessible accessible. Of course, sometimes the opposite is true... But in this task, we love them: Let's create a StringHelper class that has 2 static methods: multiply(String s, int count) - returns a string that has been repeated count times; and multiply(String s) - returns a string that has been repeated 5 times.
You can't complete this task, because you're not signed in.
Comments(5)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Tommy GuinnessLevel 12 , Newcastle West
8 October, 20:37
Hi lads whats wrong with code ?
Jyoti MauryaLevel 8 , Maihar
29 May, 11:57
woah! first I thought I'll have to do it with typecasting but then I checked the dicuss section and understood the question properly. It wasnt that difficult. :)
amousLevel 10
7 September 2018, 05:12
what do we have to do in this task ?? will we get the string or do we have to divide the strings into substrings and compare each of them to see which one is being repeated ?
RomanLevel 41
7 September 2018, 05:54
You have to make the StringHelper class, which will have 2 static methods: String multiply(String s, int count) - returns a string that has been repeated count times. String multiply(String s) - returns a string that has been repeated 5 times. For example: multiply("Amigo") returns string "AmigoAmigoAmigoAmigoAmigo" multiply("Amigo", 3) returns string "AmigoAmigoAmigo"
amousLevel 10
7 September 2018, 18:53
thank you. i thought we had to check for repetition :|