Online Java Compiler By
JavaTpoint.com
public class JavaCharacterToTitleCaseExample_1 { public static void main(String[] args) { // Create four int primitives. int cp1, cp2, cp3, cp4; // Assign the values to cp1 and cp2. cp1 = 0x0099; cp2 = 0x0080; // Assign the titlecase of cp1 and cp2 to cp3 and cp4 respectively. cp3 = Character.toTitleCase(cp1); cp4 = Character.toTitleCase(cp2); String str1 = "The titlecase for the character '" + cp1 + "' isgiven as: " + cp3; String str2 = "The titlecase for the character '" + cp2 + "' isgiven as: " + cp4; // Print the values of cp3 and cp4. System.out.println( str1 ); System.out.println( str2 ); } }
Output