Free Cheat-test Samples and Demo Questions Download
Adobe exams Adobe
Apple exams Apple
Avaya exams Avaya
Check Point exams Check Point
Cisco exams Cisco
Citrix exams Citrix
CIW exams CIW
CompTIA exams CompTIA
CWNP exams CWNP
EC-Council exams EC-Council
EMC exams EMC
Exin exams Exin
Fortinet exams Fortinet
GIAC exams GIAC
Hitachi exams Hitachi
HP exams HP
IBM exams IBM
Isaca exams Isaca
ISC exams ISC
ISEB exams ISEB
Juniper exams Juniper
LPI exams LPI
McAfee exams McAfee
Microsoft exams Microsoft
Oracle exams Oracle
PMI exams PMI
Riverbed exams Riverbed
SNIA exams SAP
Sun exams SAS
Symantec exams Symantec
VMware exams VMware
All certification exams

Sun 310-036 Exam - Cheat-Test.com

Free 310-036 Sample Questions:

Q: 1 Given:
11. public static void main( String[] args ) {
12. Integer a = new Integer(10);
13. Integer b = new Integer(10);
14. Integer c = a;
15. int d = 10;
16. double e = 10.0;
17. }
Which three evaluate to true? (Choose three.)
A. (a == c)
B. (d == e)
C. (b == d)
D. (a == b)
E. (b == c)
F. (d == 10.0)
Answer: A, B, F

Q:2 Given:
1. public class MethodOver {
2. public void setVar(int a, int b, float c) {
3. }
4. }
Which two overload the setVar method? (Choose two.)
A. private void setVar(int a, float c, int b) { }
B. protected void setVar(int a, int b, float c) { }
C. public int setVar(int a, float c, int b) {return a; }
D. public int setVar(int a, int b, float c) {return a; }
E. protected float setVar(int a, int b, float c) {return c; }
Answer: A, C

Q: 3 Given:
1. package foo;
2. public class Outer {
3. public static class Inner {
4. }
5. }
Which statement is true?
A. Compilation fails.
B. An instance of the Inner class can be constructed with "new Outer.Inner()."
C. An instance of the Inner class cannot be constructed outside of package foo.
D. An instance of the Inner class can be constructed only from within the Outer class.
E. From within the package foo, an instance of the Inner class can be constructed with "new Inner()."
Answer: B

Q: 4 Given:
1. class Bar { }
1. class Test {
2. Bar doBar() {
3. Bar b = new Bar();
4. return b;
5. }
6. public static void main (String args[]) {
7. Test t = new Test();
8. Bar newBar = t.doBar();
9. System.out.println("newBar");
10. newBar = new Bar();
11. System.out.println("finishing");
12. }
13. }
At what point is the Bar object, created on line 3, eligible for garbage collection?
A. after line 8
B. after line 10
C. after line 4, when doBar() completes
D. after line 11, when main() completes
Answer: B

Q: 5 Given:
21. int i = 1;
22. int j = i++;
23. if ((i == ++j) | (i++ == j)) {
24. i += j;
25. }
26. System.out.println("i = " + i);
What is the result?
A. i = 1
B. i = 2
C. i = 3
D. i = 4
E. i = 5
F. Compilation fails.
Answer: E

Q: 6 Which two are equal? (Choose two.)
A. 16 > 4
B. 16 / 2
C. 16 * 4
D. 16 >> 2
E. 16 / 2^2
F. 16 >>> 2
Answer: D, F

Q: 7 Which statement is true?
A. If only one thread is blocked in the wait method of an object, and another thread executes the notify method on that same object, then the first thread immediately resumes execution.
B. If a thread is blocked in the wait method of an object, and another thread executes the notify method on the same object, it is still possible that the first thread might never resume execution.
C. If a thread is blocked in the wait method of an object, and another thread executes the notify method on the same object, then the first thread resumes execution as a direct and sole consequence of the notify call.
D. If two threads are blocked in the wait method of one object, and another thread executes the notify method on the same object, then the thread that executed the wait call first resumes execution as a direct and sole consequence of the notify call.
Answer: B

Q: 8 Given:
1. public class Test {
2. private static int[] x;
3. public static void main(String[] args) {
4. System.out.println(x[0]);
5. }
6. }
What is the result?
A. 0
B. null
C. Compilation fails.
D. A NullPointerException is thrown at runtime.
E. An ArrayIndexOutOfBoundsException is thrown at runtime.
Answer: D

Q: 9 What happens when thread X executes a wait() method on object A, without owning object A's lock?
A. Compilation fails.
B. An exception is thrown.
C. The wait() method has no effect.
D. Thread X receives the lock immediately.
E. Object A moves the thread to the wait pool.
Answer: B

Q: 10 Which statement is true?
A. To call the join() method, a thread must own the lock of the current thread.
B. To call the sleep() method, a thread must own the lock of the current thread.
C. To call the yield() method, a thread must own the lock of the current thread.
D. To call the notify() method, a thread must own the lock of the current thread.
E. To call the notify() method, a thread must own the lock of the object on which the call is to be made.
Answer: E

Q: 11 Given:
1. interface I0 {
2. public int method1(int x, int y);
3. public long method1(long x, long y);
4. }
Which compiles?
A. interface I1 extends I0 { }
B. interface I1 implements I0 { }
C. abstract class C1 extends I0 {
public int method1(int x, int y) { return 0; }
}
D. abstract class C1 implements I0 {
public int method1(int x, int y) { return 0; }
public short method1(long x, long y) { return 0; }
}
E. class C1 implements I0 {
public int method1(int x, int y) { return 0; }
public short method1(long x, long y) { return 0; }
}
Answer: A

Q: 12 Given:
11. int index = 1;
12. int[] foo = new int[3];
13. int bar = foo[index];
14. int baz = bar + index;
15. System.out.println(" baz = " + baz);
What is the result?
A. baz = 0
B. baz = 1
C. baz = 2
D. Compilation fails.
E. An exception is thrown at runtime.
Answer: B


© 2014 Cheat-Test.com, All Rights Reserved