单项选择题
A. 1
B. 2
C. 3
D. 4
E. 5
F. 6
单项选择题 public class MyLogger { private StringBuilder logger = new StringBuuilder(); public void log(String message, String user) { logger.append(message); logger.append(user); } } The programmer must guarantee that a single MyLogger object works properly for a multi-threaded system. How must this code be changed to be thread-safe?()
单项选择题 Given this method in a class: public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(<); buffer.append(this.name); buffer.append(>); return buffer.toString(); } Which is true?()
单项选择题 11. class Converter { 12. public static void main(String[] args) { 13. Integer i = args[0]; 14. int j = 12; 15. System.out.println(”It is “ + (j==i) + “that j==i.”); 16. } 17. } What is the result when the programmer attempts to compile the code and run it with the command java Converter 12?()