black

SCJP程序员认证考试

登录

单项选择题

public String makinStrings() { 
String s = “Fred”; 
s = s + “47”; 
s = s.substring(2, 5); 
s = s.toUpperCase(); 
return s.toString(); 
} 
How many String objects will be created when this method is invoked?() 

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?()

All Rights Reserved 版权所有©考试题库网(kstiku.com)

备案号:湘ICP备14005140号-3

经营许可证号:湘B2-20140064