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!
Text blocks
New approach
Report a typo
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);
}
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.