Editing Java - Einführung

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 25: Line 25:
Create a variable of type String with “ Hello World! ” as its content (contains leading and trailing spaces).
Create a variable of type String with “ Hello World! ” as its content (contains leading and trailing spaces).


*Print the String and its length to the console.
    *Print the String and its length to the console.
*Print the String with some variations:
    *Print the String with some variations:
**all letters in uppercase
        **all letters in uppercase
**all letters in lowercase
        **all letters in lowercase
**replace “World” with “Codersbay”
        **replace “World” with “Codersbay”
**without the leading spaces
        **without the leading spaces
*Repeat the printed String 15 times seperated with linebreaks (don't copy the code 15 times 😉)
    *Repeat the printed String 15 times seperated with linebreaks (don't copy the code 15 times 😉)


You might find the [https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html official documentation of the String class] helpful.
You might find the [https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html official documentation of the String class] helpful.

Please note that all contributions to Coders.Bay Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see CB Wiki:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)