Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Now
- String[] upcase(String[] input) {
- return Arrays.stream(input)
- .map(String::toUpperCase)
- .toArray(String[]::new);
- }
- //before
- String[] upcase(String[] input) {
- String[] result = new String[input.length]
- for (int i = 0; i < input.length; i++) {
- result[i] = input[i].toUpperCase;
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement