Write a program that reads in a line of text and then outputs that line of text first in all uppercase letters and then in all lowercase letters.
import java.util.Scanner;
public class LettersDemo {
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
String textLine;
System.out.print("Enter a line of text:");
textLine = input.nextLine();
System.out.println("Text in uppercase:"+textLine.toUpperCase());
System.out.println("Text in lowercase:"+textLine.toLowerCase());
}
}
OUTPUT:
Enter a line of text:Hello How Are You
Text in uppercase:HELLO HOW ARE YOU
Text in lowercase:hello how are you