[Free] 2017(Jan) EnsurePass Braindumps Oracle 1z0-853 Dumps with VCE and PDF 141-150

Ensurepass.com : Ensure you pass the IT Exams
2017 Jan Oracle Official New Released 1z0-853
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-853.html

Java Standard Edition 5 Programmer Certified Professional Exam

Question No: 141 – (Topic 2)

Given:

  1. class ClassA {

  2. public int numberOfInstances;

  3. protected ClassA(int numberOfInstances) {

  4. this.numberOfInstances = numberOfInstances; 5. }

6. }

  1. public class ExtendedA extends ClassA {

  2. private ExtendedA(int numberOfInstances) {

  3. super(numberOfInstances);

10. }

  1. public static void main(String[] args) {

  2. ExtendedA ext = new ExtendedA(420);

  3. System.out.print(ext.numberOfInstances);

14. }

15. }

Which statement is true?

  1. An exception is thrown at runtime.

  2. All constructors must be declared public.

  3. Constructors CANNOT use the private modifier.

  4. 420 is the output.

  5. Constructors CANNOT use the protected modifier.

Answer: D

Question No: 142 – (Topic 2)

Click the Exhibit button.

What two must the programmer do to correct the compilation errors? (Choose two.)

Ensurepass 2017 PDF and VCE

  1. insert a call to super(vin) in the MeGo constructor

  2. insert a call to this() in the MeGo constructor

  3. insert a call to this() in the Car constructor

  4. change line 3 in the MeGo class to super.wheelCount = 3;

  5. change the wheelCount variable in Car to protected

  6. insert a call to super() in the MeGo constructor

Answer: A,E

Question No: 143 – (Topic 2)

Given:

20. public class CreditCard { 21.

  1. private String cardID;

  2. private Integer limit;

  3. public String ownerName; 25.

  1. public void setCardInformation(String cardID,

  2. String ownerName,

  3. Integer limit) {

  4. this.cardID = cardID;

  5. this.ownerName = ownerName;

  6. this.limit = limit;

32. }

33. }

Which statement is true?

  1. The ownerName variable breaks encapsulation.

  2. The cardID and limit variables break polymorphism.

  3. The class is fully encapsulated.

  4. The setCardInformation method breaks encapsulation.

  5. The code demonstrates polymorphism.

Answer: A

Question No: 144 – (Topic 2)

Click the Exhibit button.

What is the output if the main() method is run?

Ensurepass 2017 PDF and VCE

  1. 5

  2. 8

  3. An exception is thrown at runtime.

  4. It is impossible to determine for certain.

  5. 9

  6. 4

  7. Compilation fails.

Answer: E

Question No: 145 DRAG DROP – (Topic 2)

Click the Task button.

Ensurepass 2017 PDF and VCE

Answer:

Ensurepass 2017 PDF and VCE

Question No: 146 – (Topic 2)

Click the Exhibit button. Given:

  1. Test t = new Test();

  2. t.method(5);

What is the output from line 5 of the Test class?

Ensurepass 2017 PDF and VCE

  1. 17

  2. 10

  3. 12

  4. 5

  5. 24

Answer: B

Question No: 147 – (Topic 2)

Given:

  1. interface A { void x(); }

  2. class B implements A { public void x() {} public void y() {} }

  3. class C extends B { public void x() {} } And:

  1. java.util.Listlt;Agt; list = new java.util.ArrayListlt;Agt;();

  2. list.add(new B());

  3. list.add(new C());

  4. for (A a : list) { 24. a.x();

25. a.y();

26. }

What is the result?

  1. An exception is thrown at runtime.

  2. The code runs with no output.

  3. Compilation fails because of an error in line 25.

  4. Compilation fails because of an error in line 20.

  5. Compilation fails because of an error in line 21.

  6. Compilation fails because of an error in line 23.

    Answer: C

    Question No: 148 DRAG DROP – (Topic 2)

    Click the Task button.

    Ensurepass 2017 PDF and VCE

    Answer:

    Ensurepass 2017 PDF and VCE

    Question No: 149 – (Topic 2)

    Given:

    1. public class Target {

    2. private int i = 0;

    3. public int addOne(){

    4. return i; 5. }

6. }

And:

  1. public class Client {

  2. public static void main(String[] args){

  3. System.out.println(new Target().addOne()); 4. }

    5. }

    Which change can you make to Target without affecting Client?

    1. Line 3 of class Target can be changed to private int addOne(){

    2. Line 2 of class Target can be changed to private Integer i = 0;

    3. Line 4 of class Target can be changed to return i ;

    4. Line 2 of class Target can be changed to private int i = 1;

Answer: B

Question No: 150 – (Topic 2)

Given:

  1. abstract public class Employee {

  2. protected abstract double getSalesAmount();

  3. public double getCommision() {

  4. return getSalesAmount() * 0.15;

14. }

15. }

  1. class Sales extends Employee {

  2. // insert method here

18. }

Which two methods, inserted independently at line 17, correctly complete the Sales class? (Choose two.)

  1. private double getSalesAmount() { return 1230.45; }

  2. protected double getSalesAmount() { return 1230.45; }

  3. public double getSalesAmount() { return 1230.45; }

  4. double getSalesAmount() { return 1230.45; }

Answer: B,C

100% Ensurepass Free Download!
Download Free Demo:1z0-853 Demo PDF
100% Ensurepass Free Guaranteed!
Download 2017 EnsurePass 1z0-853 Dumps

EnsurePass ExamCollection Testking
Lowest Price Guarantee Yes No No
Up-to-Dated Yes No No
Real Questions Yes No No
Explanation Yes No No
PDF VCE Yes No No
Free VCE Simulator Yes No No
Instant Download Yes No No

2017 EnsurePass IT Certification PDF and VCE

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.