Java String toUpperCase Example
String class toUpperCase method example
String class toUpperCase method example. This example shows you how to use toUpperCase method.This method Converts all of the characters in this String to upper case using the rules of the default locale.
Here is the code:-
/**
* @(#) UpperCasestring.java
*Program Shows a class representing the Conversion of the String into Upper Case
* @Version 01-April-2008
* @author Rose India Team
*/
class UpperCasestring
{
public static void main(String[] args)
{
// Declaration of String
String s=" Welcome to Rose India.net";
// Converts all of the characters in this String to Upper case
String s2=s.toUpperCase();
//Displays the Actual String declared above
System.out.println("Actual String="+s);
System.out.println("");
//Displays the Actual String declared above into Upper Case
System.out.println("String in Upper Case is ="+s2);
}
} |
-
|