Example For toUpperCase() method in java

Example For toUpperCase() method in java


Posted in : Core Java Posted on : October 1, 2010 at 3:31 PM Comments : [ 0 ]

Here, We will discuss about the toUpperCase() method of the character class.

Example For toUpperCase() method in java

In this section, We will discuss about the toUpperCase() method of the character class. This method is used to convert lower case character in to Upper case. This method converts the argument to Upper case using case mapping info of the Unicode data File. This method returns right value for a range of characters.

Example: CharacterToUpperCase.java

package com.devmanuals;

public class CharacterToUpperCase {

	public static void main(String[] args) {
		System.out.print("The Upper Case of g is= ");
		System.out.println(Character.toUpperCase('g'));
		System.out.print("The Upper Case of b is= ");
		System.out.println(Character.toUpperCase('b'));
		System.out.print("The Upper Case of t is= ");
		System.out.println(Character.toUpperCase('t'));
	}

}

Output:

The Upper Case of g is= G

The Upper Case of b is= B

The Upper Case of t is= T

Download This Example.

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics