Java字符串大小写转换的方法有以下几种:
String str = "hello";
String upperCaseStr = str.toUpperCase();
System.out.println(upperCaseStr); // 输出: HELLO
String str = "HELLO";
String lowerCaseStr = str.toLowerCase();
System.out.println(lowerCaseStr); // 输出: hello
String str = "hello";
char ch = str.charAt(0);
char upperCaseCh = Character.toUpperCase(ch);
System.out.println(upperCaseCh); // 输出: H
String str = "HELLO";
char ch = str.charAt(0);
char lowerCaseCh = Character.toLowerCase(ch);
System.out.println(lowerCaseCh); // 输出: h