Aan de slagGa gratis aan de slag

Upper or lower

Text formatting is everywhere - from standardizing user input to creating consistent output. Strings have powerful built-in methods that can instantly transform text. Let's explore how Java makes text manipulation effortless!

Deze oefening maakt deel uit van de cursus

Introduction to Java

Cursus bekijken

Oefeninstructies

  • Output the message String in uppercase letters.
  • Output the message String in lowercase letters.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

class ShoutItOut {
    public static void main(String[] args) {
        String message = "It's a good day to have a good day!";
        
        // Print the message in uppercase
        System.out.println(message.____);
        
        // Print the message in lowercase
        System.out.println(____);
    }
}
Code bewerken en uitvoeren