Oracle Java Certified Programmer 認定 1Z0-501 試験問題:
1. The file "file.txt" exists on the file system and contsins ASCII text.
Given:
3 8. try {
3 9. File f = new File("file.txt");
4 0. OutputStream out = new FileOutputStream(f, true);
4 1. }
4 2. catch (IOException){}
What is the result?
A) The code runs and sets the length of the file to 0.
B) An exception is thrown because the file is not closed.
C) The code runs and deletes the file from the file system.
D) The code runs and no change is made to the file.
E) The code does not compile.
2. Which gets the name of the parent directory file "file.txt"?
A) String name= (new File("file.txt")).getParentFile();
B) Directory dir=(new File ("file.txt")).getParentDir();
String name= dir.getName();
C) String name = (new File("file.txt")).getParentName();
D) String name= (new File("file.txt")).getParent();
E) String name= File.getParentName("file.txt");
3. Exhibit:
1 . package foo;
2 .
3 . import java.util.Vector;
4 .
5 . private class MyVector extends Vector {
6 . int i = 1;
7 . public MyVector(){
8 . i = 2;
9 .}
1 0. }
1 1.
1 2. public class MyNewVector extends MyVector {
1 3. public MyNewVector (){
1 4. i = 4;
1 5. }
1 6. public static void main (String args []){
1 7. MyVector v = new MyNewVector();
1 8.}
1 9. }
The file MyNewVector.java is shown in the exhibit.
What is the result?
A) Compilation will fail at line 6.
B) Compilation will fail at line 14.
C) Compilation will succeed.
D) Compilation will fail at line 17.
E) Compilation will fail at line 5.
4. Which two statements are true? (Choose Two)
A) An anonymous inner class can be declared as private.
B) An anonymous inner class can be declared as public.
C) An inner class may be declared as static.
D) An anonymous inner class can be declared as protected.
E) An anonymous inner class can extend an abstract class.
5. Which method is an appropriate way to determine the cosine of 42 degrees?
A) Double d = Math.cosine(42);
B) Double d = Math.cosine(Math.toRadians(42));
C) Double d = Math.cos(Math.toRadians(42));
D) Double d = Math.cos(Math.toDegrees(42));
E) Double d = Math.cos(42);
質問と回答:
| 質問 # 1 正解: E | 質問 # 2 正解: D | 質問 # 3 正解: E | 質問 # 4 正解: C、E | 質問 # 5 正解: C |














960 お客様のコメント
品質保証JPexamはIT認定試験のシラバスに従って、試験問題の範囲を正確に絞って、的中率が99%の最新問題集を捧げます。
1年間の無料更新サービスJPexamは1年以内に問題集の無料更新サービスを提供し、お客様がいつでも最新版の問題集を持つことを保証いたします。もし試験の内容が変更されたら、弊社は直ちにお客様にお知らせします。それに、弊社の問題集が更新されたら、早速メールで最新バージョンを送付いたします。
全額返金JPexamの問題集を利用すると、短時間で勉強しても試験に合格できるのを保証いたします。試験に不合格になってしまった場合、弊社は全額返金いたします。(
ご購入前のお試しJPexamは問題集のサンプルを無料で提供いたします。ご購入前にサンプルを試用して製品の品質を確認することができます。ご遠慮なく利用してください。
