black

SCJP程序员认证考试

登录

单项选择题

What will be written to the standard output when the following program is run?()  
public class Q03e4 {  
public static void main(String args[]) {  
String space = " ";  
String composite = space + "hello" + space + space;  
composite.concat("world");  
String trimmed = composite.trim();  
System.out.println(trimmed.length()); 
 }  
}  

A.5
B.6
C.7
D.12
E.13

相关考题

单项选择题 GiventhatfileisareferencetoaFileobjectthatrepresentsadirectory,whichcodefragmentswillsucceedinobtainingalistoftheentriesinthedirectory?()

填空题 Given the following code, write a line of code that, when inserted at the indicated location, will make the overriding method in Extension invoke the overridden method in class Base on the current object.   class Base {   public void print() {   System.out.println("base");   }   }   class Extention extends Base {   public void print() {   System.out.println("extension");   // insert line of implementation here   }   }   public class Q294d {   public static void main(String args[]) {   Extention ext = new Extention();   ext.print();   }   }   Fill in a single line of implementation.()

单项选择题 Whichstatementsaretrue,giventhecodenewFileOutputStream("data",true)forcreatinganobjectofclassFileOutputStream?()

All Rights Reserved 版权所有©易学考试网(yxkao.com)

备案号:湘ICP备2022003000号-3