[Free] 2018(Jan) EnsurePass Testinsides Oracle 1z0-851 Dumps with VCE and PDF 191-200

By | January 25, 2018

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

Java Standard Edition 6 Programmer Certified Professional Exam

Question No: 191 – (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. The code runs with no output.

  2. An exception is thrown at runtime.

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

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

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

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

    Answer: F

    Question No: 192 – (Topic 2)

    Given:

    1. package test; 2.

  1. class Target {

  2. public String name = quot;helloquot;; 5. }

    What can directly access and change the value of the variable name?

    1. any class

    2. only the Target class

    3. any class in the test package

    4. any class that extends Target

      Answer: C

      Question No: 193 – (Topic 2)

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

      Ensurepass 2018 PDF and VCE

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

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

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

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

      5. change the wheelCount variable in Car to protected

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

      Answer: D,E

      Question No: 194 – (Topic 2)

      A team of programmers is involved in reviewing a proposed design for a new utility class. After some discussion, they realize that the current design allows other classes to access methods in the utility class that should be accessible only to methods within the utility class itself. What design issue has the team discovered?

      1. Tight coupling

      2. Low cohesion

      3. High cohesion

      4. Loose coupling

      5. Weak encapsulation

      6. Strong encapsulation

      Answer: E

      Question No: 195 – (Topic 2)

      Given:

  3. class Thingy { Meter m = new Meter(); }

  4. class Component { void go() { System.out.print(quot;cquot;); } }

  5. class Meter extends Component { void go() { System.out.print(quot;mquot;); } } 8.

  1. class DeluxeThingy extends Thingy {

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

  3. DeluxeThingy dt = new DeluxeThingy();

  4. dt.m.go();

  5. Thingy t = new DeluxeThingy();

14. t.m.go();

15. }

16. }

Which two are true? (Choose two.)

  1. The output is mm.

  2. The output is mc.

  3. Component is-a Meter.

  4. Component has-a Meter.

  5. DeluxeThingy is-a Component.

  6. DeluxeThingy has-a Component.

Answer: A,F

Question No: 196 – (Topic 2)

Given:

10. interface Jumper { public void jump(); } …

20. class Animal {} …

  1. class Dog extends Animal {

  2. Tail tail; 32. } …

  1. class Beagle extends Dog implements Jumper{

  2. public void jump() {} 42. } …

  1. class Cat implements Jumper{

  2. public void jump() {}

52. }

Which three are true? (Choose three.)

  1. Cat is-a Animal

  2. Cat is-a Jumper

  3. Dog is-a Animal

  4. Dog is-a Jumper

  5. Cat has-a Animal

  6. Beagle has-a Tail

  7. Beagle has-a Jumper

Answer: B,C,F

Question No: 197 – (Topic 2)

Click the Exhibit button. What is the result?

Ensurepass 2018 PDF and VCE

  1. Value is: 8

  2. Compilation fails.

  3. Value is: 12

  4. Value is: -12

  5. The code runs with no output.

  6. An exception is thrown at runtime.

Answer: A

Question No: 198 – (Topic 2)

Given a valid DateFormat object named df, and

  1. Date d = new Date(0L);

  2. String ds = quot;December 15, 2004quot;;

  3. // insert code here What updates d#39;s value with the date represented by ds?

    1. 18. d = df.parse(ds);

    2. 18. d = df.getDate(ds);

    3. 18. try {

  4. d = df.parse(ds);

  5. } catch(ParseException e) { };

  1. 18. try {

  1. d = df.getDate(ds);

  2. } catch(ParseException e) { };

Answer: C

Question No: 199 – (Topic 2)

Which two scenarios are NOT safe to replace a StringBuffer object with a StringBuilder object? (Choose two.)

  1. When using versions of Java technology earlier than 5.0.

  2. When sharing a StringBuffer among multiple threads.

  3. When using the java.io class StringBufferInputStream.

  4. When you plan to reuse the StringBuffer to build more than one string.

Answer: A,B

Question No: 200 – (Topic 2)

Given:

  1. String test = quot;a1b2c3quot;;

  2. String[] tokens = test.split(quot;\\dquot;);

  3. for(String s: tokens) System.out.print(s quot; quot;); What is the result?

A. a b c

B. 1 2 3

  1. a1b2c3

  2. a1 b2 c3

  3. Compilation fails.

  4. The code runs with no output.

  5. An exception is thrown at runtime.

Answer: A

100% Ensurepass Free Download!
Download Free Demo:1z0-851 Demo PDF
100% Ensurepass Free Guaranteed!
1z0-851 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

Leave a Reply

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