Oracle Java SE 7 Programmer I - 1Z1-803 模擬練習

Given:

正解: D
Given the following code fragment:

What is the result if the integer value is 33?

正解: B
解説: (PassTest メンバーにのみ表示されます)
Given: What is the result?

正解: E
Given:

Which two classes use the shape class correctly?

正解: C,D
解説: (PassTest メンバーにのみ表示されます)
Given the fragments:

Which line causes a compilation error?

正解: C
Given:
public class App { // Insert code here System.out.print("Welcome to the world of Java"); }
}
Which two code fragments, when inserted independently at line // Insert code here, enable the program to execute and print the welcome message on the screen?

正解: B,C
解説: (PassTest メンバーにのみ表示されます)
Given:
public class TestField { int x; int y; public void doStuff(int x, int y) { this.x = x; y =this.y; } public void display() { System.out.print(x + " " + y + " : "); } public static void main(String[] args) { TestField m1 = new TestField(); m1.x = 100; m1.y = 200;
TestField m2 = new TestField();
m2.doStuff(m1.x, m1.y);
m1.display();
m2.display();
}
}
What is the result?

正解: A
Given:

Which approach ensures that the class can be compiled and run?

正解: A
解説: (PassTest メンバーにのみ表示されます)
Given the classes:
*AssertionError
*ArithmeticException
*ArrayIndexOutofBoundsException
*FileNotFoundException
*IllegalArgumentException
*IOError
*IOException
*NumberFormatException
*SQLException
Which option lists only those classes that belong to the unchecked exception category?

正解: B
解説: (PassTest メンバーにのみ表示されます)
Given:

What is the result?

正解: C
Which code fragment cause a compilation error?

正解: D