查java docs一下了就可以看到了toUpperCase public String toUpperCase() Converts all of the characters in this String to upper case using the rules of the default locale, which is returned by Locale.getDefault. 
If no character in this string has a different uppercase version, based on calling the toUpperCase method defined by Character, then the original string is returned. 
Otherwise, this method creates a new String object representing a character sequence identical in length to the character sequence represented by this String object and with every character equal to the result of applying the method Character.toUpperCase to the corresponding character of this String object. Examples:   "Fahrvergnen".toUpperCase() returns "FAHRVERGN軶EN"
"Visit Ljubinje!".toUpperCase() returns "VISIT LJUBINJE!"Returns: the string, converted to uppercase.

解决方案 »

  1.   

    不用啊
    String a="aAbBcC";
    a=a.toUpperCase();
    System.out.println(a);//result is AABBCC
      

  2.   

    首先,该函数必须在String类型的对象上调用,比如前面老兄给的String a;
    的a。然后他将该String对象的字符串内容转换成大写,然后返回以大写的内容为内容的String对象。
    你可以使用一个引用指向结果。  比如上面老兄的a=就是。
    建议看一下面向对象+Java的定义(声明)+赋值+引用。这是学习java最基本的。(基本也是学习现代编程语言或高层建筑(我指UML等)的基础)
      

  3.   

    可以这样用:System.out.println("abCD".toUpperCase());
    这行代码将字符串中的所有小写字母转换为大写输出。
    祝你好运!