public void test() {
try { oneMethod();
System.out.println("condition 1");
}
catch (ArrayIndexOutOfBoundsException e) {
System.out.println("condition 2");
}
catch(Exception e) {
System.out.println("condition 3");
}
finally {
System.out.println("finally");
}
}
Which will display if oneMethod run normally?()
A. condition 1
B. condition 2
C. condition 3
D. finally
您可能感兴趣的试卷
你可能感兴趣的试题
A. Instance variables are member variables of a class.
B. Instance variables are declared with the static keyword.
C. Local variables defined inside a method are created when the method is executed.
D. Local variables must be initialized before they are used.
Given the uncompleted code of a class:
class Person {
String name, department;
int age;
public Person(String n){
name = n;
}
public Person(String n, int a){
name = n;
age = a;
}
public Person(String n, String d, int a) {
// doing the same as two arguments version of constructor
// including assignment name=n,age=a department = d;
}
}
Which expression can be added at the "doing the same as..." part of the constructor?()
A. Person(n,a);
B. this(Person(n,a));
C. this(n,a);
D. this(name,age);
A. float f = 11.1;
B. double d = 5.3E12;
C. double d = 3.14159;
D. double d = 3.14;.
A. The program developer must create a thread to be responsible for free the memory.
B. The garbage collection will check for and free memory no longer needed.
C. The garbage collection allow the program developer to explicity and immediately free the memory.
D. The garbage collection can free the memory used java object at expect time.
Given the following expression about TextField which use a proportional pitch font.
TextField t = new TextField("they are good",40);
Which statement is true?()
A. The displayed string can use multiple fonts.
B. The maximum number of characters in a line will be 40.
C. The displayed width is exactly 40 characters.
D. The user can edit the characters.
Given the following code:
if (x>0) {
System.out.println("first");
}
else if (x>-3) {
System.out.println("second");
}
else {
System.out.println("third");
}
Which range of x value would print the string "second"?()
A. x > 0
B. x > -3
C. x <= -3
D. x <= 0 & x > -3
A. int
B. void
C. boolean
D. static
A. on line 2
B. on line 3
C. on line 6
D. on line 7
A. The equals() method determines if reference values refer to the same object.
B. The == operator determines if the contents and type of two separate objects match.
C. The equals() method returns true only when the contents of two objects match.
D. The class File overrides equals() to return true if the contents and type of two separate objects match.
A. TRUE
B. sizeof
C. const
D. super
E. void
最新试题
Which statement is true?()
Which statement is true about the set variable on line 12?()
Which two of statements are true?()
A programmer must create a generic class MinMax and the type parameter of MinMax must implement Comparable. Which implementation of MinMax will compile?()
Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo() method, which two statements are true?()
What can be a result?()
Which statement is true?()
Which statement is true?()
What is the result?()
What is the result?()