单项选择题

int i = 1,j = 10; 
do { 
if(i>j) { 
break; 
}
j--; 
} while (++i <5); 
System.out.println(“i =” +i+” and j = “+j);
What is the result?()

A. i = 6 and j = 5
B. i = 5 and j = 5
C. i = 6 and j = 4
D. i = 5 and j = 6
E. i = 6 and j = 6


您可能感兴趣的试卷

你可能感兴趣的试题

1.多项选择题

class A { 
A() { } 
} 
class B extends A { 
} 
Which two statements are true?()

A. Class B’s constructor is public.
B. Class B’s constructor has no arguments.
C. Class B’s constructor includes a call to this().
D. Class B’s constructor includes a call to super().

4.多项选择题Which two cause a compiler error?() 

A. float[] = new float(3);
B. float f2[] = new float[];
C. float[] f1 = new float[3];
D. float f3[] = new float[3];
E. float f5[] = { 1.0f, 2.0f, 2.0f };
F. float f4[] = new float[] { 1.0f. 2.0f. 3.0f};

6.单项选择题Which interface does java.util.Hashable implement?()  

A. Java.util.Map.
B. Java.util.List.
C. Java.util.Hashable.
D. Java.util.Collection.

7.多项选择题Which two interfaces provide the capability to store objects using a key-value pair?()

A. Java.util.Map.
B. Java.util.Set.
C. Java.util.List.
D. Java.util.StoredSet.
E. Java.util.StoredMap.
F. Java.util.Collection.

9.多项选择题Which statements about static inner classes are true?()

A. A static inner class requires a static initializer.
B. A static inner class requires an instance of the enclosing class.
C. A static inner class has no reference to an instance of the enclosing class.
D. A static inner class has access to the non-static members of the outer class.
E. Static members of a static inner class can be referenced using the class name of the static inner  class.

10.多项选择题

public class MethodOver {  
private int x, y;  
private float z;  
public void setVar(int a, int b, float c){  
x = a;  
y = b;  
z = c;  
}  
}  
Which two overload the setVar method?()

A. void setVar (int a, int b, float c){  x = a;  y = b;  z = c;  }
B. public void setVar(int a, float c, int b) {  setVar(a, b, c);  }
C. public void setVar(int a, float c, int b) {  this(a, b, c);  }
D. public void setVar(int a, float b){  x = a;  z = b;  }
E. public void setVar(int ax, int by, float cz) {  x = ax;  y = by;  z = cz;  }

最新试题

Given that t1 is a reference to a live thread, which is true?()

题型:单项选择题

What is the result?()

题型:单项选择题

Which two changes, taken together, would guarantee the output: 1, 2, 3, 4, 5?()

题型:多项选择题

What is the result?()

题型:单项选择题

What is the result?()

题型:单项选择题

What is the appropriate definition of the hashCode method in class Person?()

题型:单项选择题

A programmer iterates over the TreeSet and prints the name of each Drink object.  What is the result?()

题型:单项选择题

Given:  foo and bar are public references available to many other threads, foo refers to a Thread and bar is an Object. The thread foo is currently executing bar.wait().  From another thread, what provides the most reliable way to ensure that foo will stop executing wait()?()

题型:单项选择题

A programmer is developing a class Key, that will be used as a key in a standard java.util.HashMap.  Which two methods should be overridden to assure that Key works correctly as a key?()

题型:多项选择题

Which two statements are true?()

题型:多项选择题