Wait, wait, wait... Did anyone else notice that the Messenger class is importing 'java.io.PrintStream'? That's like bringing a bazooka to a nerf gun fight! No wonder they need to print 'All the best' - they're overcompensating for something!
I'm leaning towards option A) void writeMsg(). The question says to insert the code fragment at line n1, and since the writeMsg() method doesn't seem to have a return type, it might be the way to go. Let's see if I'm right!
Haha, I bet the answer is D) m.writeMsg(). Why? Because m is a variable in the code, and it's probably an instance of the Messenger class, so we should use that to call the writeMsg() method. Come on, it's not that hard!
I'm going with option B) Messenger.writeMsg(). The Messenger class seems to be the one responsible for the writeMsg() method, so we should access it through the class rather than directly calling the method.
I think the correct answer is C) writeMsg(). The code fragment clearly shows that the writeMsg() method is a static method, so we can call it directly without creating an instance of the Messenger class.
Ashton
1 months agoAlbert
1 months agoTresa
1 months agoDahlia
1 months agoMable
13 days agoRosendo
16 days agoLajuana
20 days agoLindsey
21 days agoTy
1 months agoMaryln
1 months agoDulce
2 months agoPaulina
2 months agoKris
2 months agoAlonso
3 months agoAmira
3 months agoAlonso
3 months ago