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 |
[ 0 ] Comments