import java.util.Scanner;
public class Principal {
public static void main(String[] args) {
Scanner leitura = new Scanner(System.in);
System.out.print("Digite o texto: ");
String texto = leitura.nextLine();
System.out.println("Texto em maiúsculas: " + texto.toUpperCase());
System.out.println("Texto em minúsculas: " + texto.toLowerCase());
}
}
Saída:
Digite o texto: Olá, Mundo!
Texto em maiúsculas: OLÁ, MUNDO!
Texto em minúsculas: olá, mundo!