The results is correct but there is even the same error with or without external method
package com.codegym.task.task08.task0823;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
Going national
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
String res = "";
String[] block = s.split(" ");
for (int i = 0; i <block.length ; i++) {
int blockLenght = block[i].length();
String firstUpper = block[i].substring(0,1).toUpperCase();
String lestUpper = block[i].substring(1,blockLenght);
res+=(firstUpper + lestUpper + " ");
}
System.out.println(res);
// firstUpperCase(s);
}
// public static void firstUpperCase(String data){
// String res = "";
//
// String[] block = data.split(" ");
//
// for (int i = 0; i <block.length ; i++) {
// int blockLenght = block[i].length();
// String firstUpper = block[i].substring(0,1).toUpperCase();
// String lestUpper = block[i].substring(1,blockLenght);
// res+=(firstUpper + lestUpper + " ");
// }
// System.out.println(res);
// }
}