I also use Character.toUpperCase() method (see my comment), but it does not work.
I hope someone can help me. Thx.
package zh.codegym.task.task08.task0823;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
/*
走向全国
*/
public class Solution {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
String[] string = s.split(" ");
ArrayList<String> list = new ArrayList<String>();
for (String a: string) {
char[] ch = a.toCharArray();
ch[0] -= 32;
// Character.toUpperCase(ch[0]);
list.add(new String(ch));
}
for (String b: list) {
System.out.print(b + " ");
}
}
}