易搜题 > 资格证大类 > 计算机编程 > 问题详情
问题详情

int i = 0;  while (true) { if(i==4) {  break;  }  ++i;  }  System.out.println(“i=”+i);  What is the result?()  

A、 i = 0

B、 i = 3

C、 i = 4

D、 i = 5

E、 Compilation fails.

未找到的试题在搜索页框底部可快速提交,在会员中心"提交的题"查看可解决状态。 收藏该题
查看答案

相关问题推荐

  • class TestA {  public void start() { System.out.println(”TestA”); }  }  public class TestB extends TestA {  public void start() { System.out.println(”TestB”); } public static void main(String[] args) {  ((TestA)new TestB()).start();  }  }  What is the result?() 

    A、 TestA

    B、 TestB

    C、 Compilation fails.

    D、 An exception is thrown at runtime.

  • int index = 1;  boolean[] test = new Boolean[3];  boolean foo= test [index];   What is the result?()  

    A、 Foo has the value of 0.

    B、 Foo has the value of null.

    C、 Foo has the value of true.

    D、 Foo has the value of false.

    E、 An exception is thrown.

    F、 The code will not compile.

  • A team of programmers is reviewing a proposed API for a new utility class.After some discussion, they realize that they can reduce the number of methods in the API without losing any functionality.If they implement the new design, which two principles will they be promoting?()

    A

    Looser coupling

    B

    Tighter coupling

    C

    Lower cohesion

    D

    Higher cohesion

    E

    Weaker encapsulation

    F

    Stronger encapsulation

  • What is the result?()

    A、 null

    B、 zero

    C、 some

    D、 Compilation fails.

    E、 An exception is thrown at runtime.

  • Given:   1.d is a valid, non-null Date object   2.df is a valid, non-null DateFormat object set to the current locale    What outputs the current locale’s country name and the appropriate version of d’s date?()

    A、Locale loc = Locale.getLocale(); System.out.println(loc.getDisplayCountry()+   + df.format(d));

    B、Locale loc = Locale.getDefault(); System.out.println(loc.getDisplayCountry()+   + df.format(d));

    C、Locale loc = Locale.getLocale();System.out.println(loc.getDisplayCountry()+   + df.setDateFormat(d));

    D、 Locale loc = Locale.getDefault();System.out.println(loc.getDisplayCountry()+   + df.setDateFormat(d));

联系客服 会员中心
TOP