New approach

Report a typo

Are you ready to take your Java skills to the next level? Rewrite the provided string oldString using text blocks and show off your coding skills by displaying the result on the screen. Don't forget to watch out for those sneaky quotation marks and remember not to leave any empty lines at the end!

Sample Input 1:

Sample Output 1:

"Why do programmers prefer dark mode?" she asked.
"Because light attracts bugs!" I replied.
Write a program in Java 17
public class Main {
public static void main(String[] args) {
String oldString = "\"Why do programmers prefer dark mode?\" she asked.\n" +
"\"Because light attracts bugs!\" I replied.";

String youngAndStrongTextBlock = //write the code here using text block

System.out.println(youngAndStrongTextBlock);
}
}
___

Create a free account to access the full topic