Alphabet Character Case-Converter

Ads
 

Alphabet Character Case-Converter

In this section, you will learn to convert a character (uppercase) into a lowercase character.

In this section, you will learn to convert a character (uppercase) into a lowercase character.

Alphabet Character Case-Converter

     

In this section, you will learn to convert a character (uppercase) into a lowercase character. The java.lang package provides the functionality to convert the uppercase character into a lowercase character. 

Code Description:

The following program helps you in converting a uppercase character (R) into a lowercase character (r). Program takes a character (uppercase) at the console and it converts it  into a lowercase character using the  toLowerCase() method. This method converts the  uppercase character into  the lowercase character and returns converted lowercase character. 

Here is the code of this program:

import java.io.*;
import java.lang.*;

  public class CharToLowercase{
  public static void main(String args[]) throws IOException{
  BufferedReader buff = 
 
new BufferedReader(new InputStreamReader(System.in));
  System.out.println("Enter the uppercase character:");
  String s = buff.readLine();
  char c = s.charAt(0);
  char lower = Character.toLowerCase(c);
  System.out.println("Lowercase character: " + lower);
  }
  }

Download this program:

Output of this program.

C:\corejava>java CharToLowercase
Enter the uppercase character:
R
Lowercase character: r
C:\corejava>

Ads

Ads