2014 Latest Oracle 1Z0-853 Exam Demo Free Download!

QUESTION 1
Given:
10. class One {
11. void foo() { }
12. }
13. class Two extends One {
14. //insert method here
15. }
Which three methods, inserted individually at line 14, will correctly complete class Two? (Choose three.)

A.    public void foo() { /* more code here */ }
B.    private void foo() { /* more code here */ }
C.    protected void foo() { /* more code here */ }
D.    int foo() { /* more code here */ }
E.    void foo() { /* more code here */ }

Answer: ACE

QUESTION 2
Which two code fragments correctly create and initialize a static array of int elements.? (Choose two.)

A.    static final int[] a = { 100,200 };
B.    static final int[] a;
static { a=new int[2]; a[0]=100; a[1]=200; }
C.    static final int[] a;
static void init() { a = new int[3]; a[0]=100; a[1]=200; }
D.    static final int[] a = new int[2]{ 100,200 };

Answer: AB

QUESTION 3
Click the Exhibit button. Given this code from Class B:
25. A a1 = new A();
26. A a2 = new A();
27. A a3 = new A();
28. System.out.println(A.getInstanceCount());
What is the result?

A.    Compilation of class A fails.
B.    Line 28 prints the value 3 to System.out.
C.    Line 28 prints the value 1 to System.out.
D.    Compilation fails because of an error on line 28.
E.    A runtime error occurs when line 25 executes.

Answer: A
QUESTION 4
Given:
20. public class CreditCard {
21.
22. private String cardID;
23. private Integer limit;
24. public String ownerName;
25.
26. public void setCardInformation(String cardID,
27. String ownerName,
28. Integer limit) {
29. this.cardID = cardID;
30. this.ownerName = ownerName;
31. this.limit = limit;
32. }
33. }
Which statement is true?

A.    The cardID and limit variables break polymorphism.
B.    The code demonstrates polymorphism.
C.    The ownerName variable breaks encapsulation.
D.    The setCardInformation method breaks encapsulation.
E.    The class is fully encapsulated.

Answer: C

QUESTION 5
Given:
11. public class Yikes {
12.
13. public static void go(Long n) {System.out.println(“Long “);}
14. public static void go(Short n) {System.out.println(“Short “);}
15. public static void go(int n) {System.out.println(“int “);}
16. public static void main(String [] args) {
17. short y = 6;
18. long z = 7;
19. go(y);
20. go(z);
21. }
22. }
What is the result?

A.    An exception is thrown at runtime.
B.    int Long
C.    Compilation fails.
D.    Short Long

Answer: B
QUESTION 6
Given:
11. public class ItemTest {
12. private final int id;
13. public ItemTest(int id) { this.id = id; }
14. public void updateId(int newId) { id = newId; }
15.
16. public static void main(String[] args) {
17. ItemTest fa = new ItemTest(42);
18. fa.updateId(69);
19. System.out.println(fa.id);
20. }
21. }
What is the result?

A.    A new Item object is created with the preferred value in the id attribute.
B.    The attribute id in the Item object is modified to the new value.
C.    Compilation fails.
D.    An exception is thrown at runtime.
E.    The attribute id in the Item object remains unchanged.

Answer: C

QUESTION 7
Click the Exhibit button. Given:
25. try {
26. A a = new A();
27. a.method1();
28. } catch (Exception e) {
29. System.out.print(“an error occurred”);
30. }
Which two statements are true if a NullPointerException is thrown on line 3 of class C? (Choose two.)

A.    The application will crash.
B.    The code on line 29 will be executed.
C.    The code on line 5 of class A will execute.
D.    The exception will be propagated back to line 27.
E.    The code on line 5 of class B will execute.

Answer: BD

 

QUESTION 8
Given:
10. interface Jumper { public void jump(); } …
20. class Animal {} …
30. class Dog extends Animal {
31. Tail tail;
32. }

40. class Beagle extends Dog implements Jumper{
41. public void jump() {} 42. }

50. class Cat implements Jumper{
51. public void jump() {}
52. }.
Which three are true? (Choose three.)

A.    Cat is-a Jumper
B.    Cat is-a Animal
C.    Dog is-a Jumper
D.    Dog is-a Animal
E.    Beagle has-a Jumper
F.    Cat has-a Animal
G.    Beagle has-a Tail

Answer: ADG

QUESTION 9
Given:
11. public static void main(String[] args) {
12. Object obj = new int[] { 1, 2, 3 };
13. int[] someArray = (int[])obj;
14. for (int i : someArray) System.out.print(i + ” “);
15. }
What is the result?

A.    Compilation fails because of an error in line 13.
B.    A ClassCastException is thrown at runtime.
C.    1 2 3
D.    Compilation fails because of an error in line 14.
E.    Compilation fails because of an error in line 12.

Answer: C

 

QUESTION 10
Given:
10. class Line {
11. public static class Point {}
12. }
13.
14. class Triangle {
15. // insert code here
16. }
Which code, inserted at line 15, creates an instance of the Point class defined in Line?

A.    Line l = new Line() ; l.Point p = new l.Point();
B.    Line.Point p = new Line.Point();
C.    The Point class cannot be instatiated at line 15.
D.    Point p = new Point();

Answer: B
Passing your Oracle 1Z0-853 Exam by using the latest 1Z0-853 Exam Dump Full Version: http://www.braindump2go.com/1z0-853.html

         

Comments are closed.