Online Java Compiler By
JavaTpoint.com
public class JavaCharactertoUpperCaseExample_1 { public static void main(String[] args) { // Initialize two char primitives. int codepoint1 = 102; int codepoint2 = 110; // Convert the codepoints to char type. char ch1 = (char) codepoint1; char ch2 = (char) codepoint2; // Convert the codepoints to uppercase. char upper1 = Character.toUpperCase(ch1); char upper2 = Character.toUpperCase(ch2); // Print the result. System.out.println("The uppercase for the character '" + ch1 + "' is given as: " + upper1); System.out.println("The uppercase for the character '" + ch2 + "' is given as: " + upper2); } }
Output