Online Java Compiler By
JavaTpoint.com
public class JavaCharactertoLowerCaseExample_2 { public static void main(String[] args) { // initialize two codePoints. int codepoint1 = 121; int codepoint2 = 95; // Convert the codepoints to char primitives. char ch1 = (char)codepoint1; char ch2 = (char)codepoint2; // Convert the code point to lower case respectively. char lower1 = Character.toLowerCase(ch1); char lower2 = Character.toLowerCase(ch2); // Print the result. String str1 = "The character '" + ch1 + "' can be represented in lower case as " + lower1; String str2 = "The character '" + ch2 + "' can be represented in lower case as " + lower2; System.out.println(str1); System.out.println(str2); } }
Output