Return to site
JAVA CERTIFICATION QUESTION: Java’s text blocks and variable-length argument lists
=>When do text blocks contain a leading new line, and when won’t you see a new line?
·
Given the following method code fragment
var f = """ ◌◌%s """.concat("◌◌").stripIndent(); f.concat(""" ◌◌%s """); System.out.print(f.formatted(new String[]{"A", "B"}));
Assume each dotted circle (◌) denotes a space character.
What is the result? Choose one.
A. A
B. ◌◌A
C. ◌◌A
◌◌B
D. A
◌◌B
E. [Ljava.lang.String;@41629346
·Ɐ uoᴉʇdo sᴉ ɹǝʍsuɐ ʇɔǝɹɹoɔ ǝɥꓕ ·uoᴉsnʅɔuoꓛ