AS
Size: a a a
AS
КМ
КМ
A
Ч
class Playground {
/**
* Implement method stringLength, which takes string as an argument
* and returns its length.
*
* Example:
* reverse(null) => 0
* reverse("") => 0
* reverse("AAA") => 3
*/
private static int stringLength(String input) {
// WRITE YOUR CODE BELOW THIS LINE
return 0;
// WRITE YOUR CODE ABOVE THIS LINE
}
public static void main(String[ ] args) {
test(stringLength(null), 0, "length of null");
test(stringLength(""), 0, "length of empty string");
test(stringLength("AAA"), 3, "length of AAA");
}Ч
КМ
КМ
КМ
Ч
КМ
КМ
IF
if (input == null) return 0;
return input.length;
КМ
Ч
КМ