[Free] 2018(Jan) EnsurePass Dumpsleader Oracle 1z0-851 Dumps with VCE and PDF 81-90

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: 81 – (Topic 1)

Click the Exhibit button. Which three code fragments, added individually at line 29, produce the output 100? (Choose three.)

Ensurepass 2018 PDF and VCE

A. n = 100;

  1. i.setX( 100 );

  2. o.getY().setX( 100 );

  3. i = new Inner(); i.setX( 100 );

  4. o.setY( i ); i = new Inner(); i.setX( 100 );

  5. i = new Inner(); i.setX( 100 ); o.setY( i );

Answer: B,C,F

Question No: 82 – (Topic 1)

A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar. Which three, taken independently, will allow the developer to use the Paper class while compiling the Book class? (Choose three.)

  1. The JAR file is located at $JAVA_HOME/jre/classes/myLib.jar.

  2. The JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jar..

  3. The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar/Paper.class.

  4. The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar.

  5. The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -cp

    /foo/myLib.jar/Paper Book.java.

  6. The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -d

    /foo/myLib.jar Book.java

  7. The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac – classpath /foo/myLib.jar Book.java

Answer: B,D,G

Question No: 83 – (Topic 1)

Given:

  1. interface DeclareStuff {

  2. public static final int EASY = 3;

  3. void doStuff(int t); }

  4. public class TestDeclare implements DeclareStuff {

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

  6. int x = 5;

  7. new TestDeclare().doStuff( x);

18. }

  1. void doStuff(int s) {

  2. s = EASY s;

  3. System.out.println(quot;s quot; s);

22. }

23. }

What is the result?

  1. s 14

  2. s 16

  3. s 10

  4. Compilation fails.

  5. An exception is thrown at runtime.

Answer: D

Question No: 84 – (Topic 1)

Given:

  1. public class Commander {

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

  3. String myProp = /* insert code here */

  4. System.out.println(myProp);

15. }

16. }

and the command line: java -Dprop.custom=gobstopper Commander Which two, placed on line 13, will produce the output gobstopper? (Choose two.)

  1. System.load(quot;prop.customquot;);

  2. System.getenv(quot;prop.customquot;);

  3. System.property(quot;prop.customquot;);

  4. System.getProperty(quot;prop.customquot;);

  5. System.getProperties().getProperty(quot;prop.customquot;);

Answer: D,E

Question No: 85 – (Topic 1)

Given:

  1. public class Spock {

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

  3. Long tail = 2000L;

  4. Long distance = 1999L;

  5. Long story = 1000L;

  6. if((tail gt; distance) ^ ((story * 2) == tail))

  7. System.out.print(quot;1quot;);

  8. if((distance 1 != tail) ^ ((story * 2) == distance))

  9. System.out.print(quot;2quot;);

12. }

13. }

What is the result?

  1. 1

  2. 2

  3. 12

  4. Compilation fails.

  5. No output is produced.

  6. An exception is thrown at runtime.

    Answer: E

    Question No: 86 – (Topic 1)

    Given:

    1. public class GC {

    2. private Object o;

    3. private void doSomethingElse(Object obj) { o = obj; }

    4. public void doSomething() {

    5. Object o = new Object();

    6. doSomethingElse(o);

    7. o = new Object();

    8. doSomethingElse(null);

    9. o = null;

      10. }

      11. }

      When the doSomething method is called, after which line does the Object created in line 5 become available for garbage collection?

      1. Line 5

      2. Line 6

      3. Line 7

      4. Line 8

      5. Line 9

      6. Line 10

Answer: D

Question No: 87 – (Topic 1)

Click the Exhibit button. What is the result?

Ensurepass 2018 PDF and VCE

  1. go in Goban go in Sente

  2. go in Sente go in Goban

  3. go in Sente go in Goban

  4. go in Goban go in Sente

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

    Answer: C

    Question No: 88 – (Topic 1)

    Given:

    1. public class Plant {

    2. private String name;

    3. public Plant(String name) { this.name = name; }

    4. public String getName() { return name; }

5. }

  1. public class Tree extends Plant {

  2. public void growFruit() { }

  3. public void dropLeaves() { } 4. }

    Which statement is true?

    1. The code will compile without changes.

    2. The code will compile if public Tree() { Plant(); } is added to the Tree class.

    3. The code will compile if public Plant() { Tree(); } is added to the Plant class.

    4. The code will compile if public Plant() { this(quot;fernquot;); } is added to the Plant class.

    5. The code will compile if public Plant() { Plant(quot;fernquot;); } is added to the Plant class.

Answer: D

Question No: 89 – (Topic 1)

Click the Exhibit button. Given:

  1. A a = new A();

  2. System.out.println(a.doit(4, 5)); What is the result?

Ensurepass 2018 PDF and VCE

  1. Line 26 prints quot;aquot; to System.out.

  2. Line 26 prints quot;bquot; to System.out.

  3. An exception is thrown at line 26 at runtime.

  4. Compilation of class A will fail due to an error in line 6.

Answer: A

Question No: 90 – (Topic 1)

Given:

11. public enum Title {

12. MR(quot;Mr.quot;), MRS(quot;Mrs.quot;), MS(quot;Ms.quot;);

  1. private final String title;

  2. private Title(String t) { title = t; }

  3. public String format(String last, String first) {

  4. return title quot; quot; first quot; quot; last;

17. }

18. }

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

  2. System.out.println(Title.MR.format(quot;Doequot;, quot;Johnquot;));

21. }

What is the result?

  1. Mr. John Doe

  2. An exception is thrown at runtime.

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

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

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

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

Your email address will not be published. Required fields are marked *

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