Write code to convert string to Upper Case
//package com.book2s; public class Main { public static void main(String[] argv) { String str = "book2s.com"; System.out.println(toUpperCase(str)); }/*from w ww .j a va 2 s. c o m*/ public static String toUpperCase(String str) { StringBuffer buffer = new StringBuffer(str); for (int i = 0; i < buffer.length(); i++) { char c = buffer.charAt(i); buffer.setCharAt(i, Character.toUpperCase(c)); } return buffer.toString(); } }