📄 mockcert07.txt
字号:
Question 92
===========================================================
Which of the following statements is/are true? Choose all correct options.
Mutiple:
1) A final class must contain at least one final method.
2) If a class contains one or more final methods, then the class must be declared final.
3) Neither of the above is true.
Question 93
===========================================================
Does this code compile?
1. class SubEx extends Exception { }
2.
3. class Parent {
4. protected void foo(int i) throws Exception {
5. if (i > 20)
6. throw new Exception();
7. }
8. }
9.
10. class Kid extends Parent {
11. void foo(int i) throws SubEx {
12. if (i < 20)
13. throw new SubEx();
14. }
15. }
Only One:
1) Yes
2) No
Question 94
===========================================================
Consider the following class definition:
class Parent { protected void abcde(int i) { } }
Which of the following methods would be allowed in a subclass of Parent? Choose all correct options.
Mutiple:
1) private void abcde(int i) { }
2) private void abcde(float i) { }
3) public void abcde(int i) { }
4) protected float abcde(int i) { return 1.2f; }
5) private float abcde(float i) { return 1.2f; }
Question 95
===========================================================
Consider the following class definition:
1. public class Sub extends Supe {
2. int i,j, k;
3. Sub(int x) { i=1; j=2; k=3; }
4. Sub(int x, y) { super(x); k=3; }
5. }
Which of the following forms of constructor must exist in the Supe class? Choose all correct options.
Mutiple:
1) Supe()
2) Supe(int i)
3) Supe(int i, int j)
4) Supe(int i, int j, int k)
Question 96
===========================================================
What happens when you try to compile and execute the following application with the command-line argument "1"? Choose all correct options.
1. class Switcheroo {
2. public static void main(String[] args) {
3. int i = 0;
4. try {
5. i = Integer.parseInt(args[0]);
6. }
7. catch (Exception e) { }
8.
9. switch (i) {
10. case 0:
11. System.out.println("zero");
12. case 1:
13. System.out.println("one");
14. default:
15. System.out.println("default");
16. }
17. }
18. }
Mutiple:
1) Compiler error.
2) The program prints "zero".
3) The program prints "one".
4) The program prints "default".
Question 97
===========================================================
Which of the following statements is/are true? Choose all correct options.
Mutiple:
1) When execution encounters a "while" loop, the body of the loop will always execute at least once.
2) When execution encounters a "do-while" loop, the body of the loop will always execute at least once.
3) When execution encounters a "for" loop, the body of the loop will always execute at least once.
Question 98
===========================================================
You have been given a design document for a system that is to be implemented in Java. The document states:
"A snack has a weight, a price, and a calorie count. A bagel is a snack that has a flag indicating if it has sesame seeds, and a textual description."
If the Snack class has already been defined, which of the following fields would be appropriate for inclusion as members of the Bagel class?
Mutiple:
1) Snack theSnack;
2) int calories;
3) Bagel theBagel;
4) boolean hasSesameSeeds;
5) String description;
Question 99
===========================================================
Consider the following class definition:
public class Parent {
final void zzz() { }
}
Which of the following methods may appear in a subclass of Parent, when the subclass is in a different package from Parent? Choose all correct options.
Mutiple:
1) void zzz() { }
2) void zzz(int j) { }
3) final void zzz(float f) { }
4) public final void zzz(double d) { }
Question 100
===========================================================
Consider the following class definitions:
class X extends Exception { }
class Y1 extends X { }
class Y2 extends Y1 { }
class Z1 extends Exception { }
class Z2 extends Z1 { }
class Parent {
void aMethod() throws X {
throw new X();
}
}
Which of the following exception types can be legally thrown from a method in a subclass of Parent, if the method's declaration begins "void aMethod() ..."?
Mutiple:
1) Exception
2) X
3) Y1
4) Y2
5) Z1
JTest
Sun Certified Programmer for Java2 Platform
Examination Score Report
CANDIDATE: JTest
CANDIDATE ID: JT12345678 DATE:2002-3-1(YYYY-MM-DD)
Exam: JTest SCJP Mock Exam
Exam Results:
Correct Answers Your Answers Result
1 2 3 4 5 1 2 3 4 5
------------------------------------------------------------------------------------
Question # 01 4 5 4 5 0
------------------------------------------------------------------------------------
Question # 02 3 3 0
------------------------------------------------------------------------------------
Question # 03 2 2 0
------------------------------------------------------------------------------------
Question # 04 2 2 0
------------------------------------------------------------------------------------
Question # 05 1 1 0
------------------------------------------------------------------------------------
Question # 06 3 3 0
------------------------------------------------------------------------------------
Question # 07 2 2 0
------------------------------------------------------------------------------------
Question # 08 2 2 0
------------------------------------------------------------------------------------
Question # 09 2 5 2 5 0
------------------------------------------------------------------------------------
Question # 10 2 2 0
------------------------------------------------------------------------------------
Question # 11 3 3 0
------------------------------------------------------------------------------------
Question # 12 1 1 0
------------------------------------------------------------------------------------
Question # 13 2 2 0
------------------------------------------------------------------------------------
Question # 14 1 1 0
------------------------------------------------------------------------------------
Question # 15 1 1 0
------------------------------------------------------------------------------------
Question # 16 1 1 0
------------------------------------------------------------------------------------
Question # 17 1 2 3 5 1 2 3 5 0
------------------------------------------------------------------------------------
Question # 18 1 3 1 3 0
------------------------------------------------------------------------------------
Question # 19 1 1 0
------------------------------------------------------------------------------------
Question # 20 4 4 0
------------------------------------------------------------------------------------
Question # 21 3 3 0
------------------------------------------------------------------------------------
Question # 22 1 1 0
------------------------------------------------------------------------------------
Question # 23 1 1 0
------------------------------------------------------------------------------------
Question # 24 2 4 2 4 0
------------------------------------------------------------------------------------
Question # 25 2 2 0
------------------------------------------------------------------------------------
Question # 26 1 3 5 1 3 5 0
------------------------------------------------------------------------------------
Question # 27 2 2 0
------------------------------------------------------------------------------------
Question # 28 4 4 0
------------------------------------------------------------------------------------
Question # 29 1 1 0
------------------------------------------------------------------------------------
Question # 30 1 1 0
------------------------------------------------------------------------------------
Question # 31 1 2 1 2 0
------------------------------------------------------------------------------------
Question # 32 4 4 0
------------------------------------------------------------------------------------
Question # 33 1 1 0
------------------------------------------------------------------------------------
Question # 34 4 4 0
------------------------------------------------------------------------------------
Question # 35 1 1 0
------------------------------------------------------------------------------------
Question # 36 2 3 4 2 3 4 0
------------------------------------------------------------------------------------
Question # 37 2 2 0
------------------------------------------------------------------------------------
Question # 38 1 1 0
------------------------------------------------------------------------------------
Question # 39 2 2 0
------------------------------------------------------------------------------------
Question # 40 4 4 0
------------------------------------------------------------------------------------
Question # 41 1 1 0
------------------------------------------------------------------------------------
Question # 42 3 3 0
------------------------------------------------------------------------------------
Question # 43 1 1 0
------------------------------------------------------------------------------------
Question # 44 1 2 3 4 1 2 3 4 0
------------------------------------------------------------------------------------
Question # 45 1 1 0
------------------------------------------------------------------------------------
Question # 46 5 5 0
------------------------------------------------------------------------------------
Question # 47 1 2 3 4 1 2 3 4 0
------------------------------------------------------------------------------------
Question # 48 1 1 0
------------------------------------------------------------------------------------
Question # 49 1 3 4 5 1 3 4 5 0
------------------------------------------------------------------------------------
Question # 50 4 4 0
------------------------------------------------------------------------------------
Question # 51 5 5 0
------------------------------------------------------------------------------------
Question # 52 4 4 0
------------------------------------------------------------------------------------
Question # 53 1 1 0
------------------------------------------------------------------------------------
Question # 54 1 1 0
------------------------------------------------------------------------------------
Question # 55 4 4 0
------------------------------------------------------------------------------------
Question # 56 1 1 0
------------------------------------------------------------------------------------
Question # 57 4 4 0
------------------------------------------------------------------------------------
Question # 58 2 2 0
------------------------------------------------------------------------------------
Question # 59 1 1 0
------------------------------------------------------------------------------------
Question # 60 2 2 0
------------------------------------------------------------------------------------
Question # 61 1 1 0
------------------------------------------------------------------------------------
Question # 62 1 3 4 1 3 4 0
------------------------------------------------------------------------------------
Question # 63 5 5 0
------------------------------------------------------------------------------------
Question # 64 3 3 0
------------------------------------------------------------------------------------
Question # 65 2 4 2 4 0
------------------------------------------------------------------------------------
Question # 66 1 2 4 1 2 4 0
------------------------------------------------------------------------------------
Question # 67 3 3 0
------------------------------------------------------------------------------------
Question # 68 1 4 1 4 0
------------------------------------------------------------------------------------
Question # 69 2 4 2 4 0
------------------------------------------------------------------------------------
Question # 70 1 1 0
------------------------------------------------------------------------------------
Question # 71 1 1 0
------------------------------------------------------------------------------------
Question # 72 2 2 0
------------------------------------------------------------------------------------
Question # 73 1 2 1 2 0
------------------------------------------------------------------------------------
Question # 74 1 2 4 1 2 4 0
------------------------------------------------------------------------------------
Question # 75 2 2 0
------------------------------------------------------------------------------------
Question # 76 2 2 0
------------------------------------------------------------------------------------
Question # 77 3 3 0
------------------------------------------------------------------------------------
Question # 78 1 1 0
------------------------------------------------------------------------------------
Question # 79 4 4 0
------------------------------------------------------------------------------------
Question # 80 1 1 0
------------------------------------------------------------------------------------
Question # 81 2 2 0
------------------------------------------------------------------------------------
Question # 82 2 3 2 3 0
------------------------------------------------------------------------------------
Question # 83 1 2 1 2 0
------------------------------------------------------------------------------------
Question # 84 3 4 5 3 4 5 0
------------------------------------------------------------------------------------
Question # 85 4 4 0
------------------------------------------------------------------------------------
Question # 86 3 3 0
------------------------------------------------------------------------------------
Question # 87 3 3 0
------------------------------------------------------------------------------------
Question # 88 2 2 0
------------------------------------------------------------------------------------
Question # 89 2 2 0
------------------------------------------------------------------------------------
Question # 90 2 2 0
------------------------------------------------------------------------------------
Question # 91 1 2 1 2 0
------------------------------------------------------------------------------------
Question # 92 3 3 0
------------------------------------------------------------------------------------
Question # 93 2 2 0
------------------------------------------------------------------------------------
Question # 94 2 3 5 2 3 5 0
------------------------------------------------------------------------------------
Question # 95 1 2 1 2 0
------------------------------------------------------------------------------------
Question # 96 3 4 3 4 0
------------------------------------------------------------------------------------
Question # 97 2 2 0
------------------------------------------------------------------------------------
Question # 98 4 5 4 5 0
------------------------------------------------------------------------------------
Question # 99 2 3 4 2 3 4 0
------------------------------------------------------------------------------------
Question # 100 2 3 4 2 3 4 0
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
Total Correct Answer:100
PASSING SCORE:61%
YOUR SCORE:100%
TEST STATUS:Pass
Mock Exam is only a means of measuring your knowledge and skill level
In order to help you further your growth and achievement in the Java Language,
Please visit online at
http://8620.virtualave.net
Thank you
Shen Yuan
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -