I don't understand what could be wrong in my code, any clue
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();
//write your code here
String text ="";
String[] arrOfStr = s.split(" ");
for (String t : arrOfStr) {
String to = t.toUpperCase().charAt(0) + t.substring(1, t.length()).toLowerCase();
text += to + " ";
}
System.out.println(text.trim());
}
}