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?()
ALooser coupling
BTighter coupling
CLower cohesion
DHigher cohesion
EWeaker encapsulation
FStronger 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));