定义一个字符串“hello world”将其转换成大写

来源:互联网 发布:python与数据分析 编辑:程序博客网 时间:2024/04/29 23:50

 /**
 *定义一个字符串“hello world”将其转换成大写。
 
*@author 马涛
 *April 14th,2009
 */
 
public class ToUpperCase
{
 public static void main(String[] args)
 {
  String str = "Hello World";
  //String类的toUpperCase()方法 把字符串变成大写
  System.out.println(str.toUpperCase());
 }
}