Albert Attard wrote:Therefore, (with the risk of being pedantic), these two methods do not cancel each other out, as indicated in the answer to question 12 in chapter 4, as shown in the attached image.
Yes, the methods do not cancel each other out
exactly, but I would say that that the explanation applies to this specific question, and not to the use of these methods in general.
Do you think that this sentence may be misleading?
Not really, because it explains why there is no space before the
'0', and the final newline doesn't really affect which of the options are valid.
Furthermore, is option D correct, given that the program will print 78 followed by a line feed?
Notice that the final statement uses
print() and not
println(), so it has the exact same effect as if
println() had been called but without the additional newline.
Even if the final statement used
println(), That would mean that the output would just contain an additional empty line, which is already covered by option E.