网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
public static void main(String[]args){ String str="null"; if(str==null){ System.out.println("null"); }else(str.length()==0){ System.out.println("zero"); }else{ System.out.println("some"); } } What is the result?()
A

null

B

zero

C

some

D

Compilationfails.

E

Anexceptionisthrownatruntime.


参考答案

参考解析
解析: 暂无解析
更多 “单选题public static void main(String[]args){ String str="null"; if(str==null){ System.out.println("null"); }else(str.length()==0){ System.out.println("zero"); }else{ System.out.println("some"); } } What is the result?()A nullB zeroC someD Compilationfails.E Anexceptionisthrownatruntime.” 相关考题
考题 单选题程序:  class MyDate{   private int year; private int month; private int day;  public MyDate(int year,int month,int day){  this.year=year;  this.month=month;      this.day=day; }  //Override Method }  为了让new MyDate(1980,11,9)==new MyDate(1980,11,9) 返回true,必须在Override Method处覆盖哪个方法?()A  hashCodeB  equalsC  toStringD  notify

考题 单选题1. import java.util.*;  2. class SubGen {  3. public static void main(String [] args) {  4. //insert code here  5. }  6. }  class Alpha { }  class Beta extends Alpha { }  class Gamma extends Beta { }  和四段代码片段:  s1. ArrayList〈? extends Alpha〉 list1 = new ArrayList〈Gamma〉();  s2. ArrayList〈Alpha〉 list2 = new ArrayList〈? extends Alpha〉();  s3. ArrayList〈? extends Alpha〉 list3 = new ArrayList〈? extends Beta〉();  s4. ArrayList〈? extends Beta〉 list4 = new ArrayList〈Gamma〉(); ArrayList〈? extends Alpha〉 list5 = list4;  哪些片段分别插入到第4行,可允许代码编译?()A 只有s1B 只有s3C 只有s1和s3D 只有s1和s4

考题 单选题11.class Snoochy{ 12.Boochybooch; 13.public Snoochy(){booch=newBoochy(this);} 14.} 15. 16.class Boochy{ 17.Snoochy snooch; 18.public Boochy(Snoochys){snooch=s;} 19.} And the statements: 21.public static void main(String[]args){ 22.Snoochy snoog=new Snoochy(); 23.snoog=null; 24.//more code here 25.} Which statement is true about the objects referenced by snoog,snooch,and booch immediately after line 23 executes?()A None of these objects are eligible for garbage collection.B Only the object referenced by booch is eligible for garbage collection.C Only the object referenced by snoog is eligible for garbage collection.D Only the object referenced by snooch is eligible for garbage collection.E The objects referenced by snooch and booch are eligible for garbage collection.

考题 多选题以下的Java程序代码中,错误的行是()Apublic class FirstAdd{        }Bpublic static void main(String args[]){        }C注释:显示 “天天好心情!”DSystem.out.println(“天好心情!”);

考题 单选题import语句的作用是()A 导入包中成员B 创建包C 既可导入包成员,也可创建包D 访问控制