[Free] 2017(Jan) EnsurePass Testinsides Oracle 1z0-852 Dumps with VCE and PDF Download 11-20

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

Java Standard Edition 6 Programmer Certified Professional Upgrade Exam

Question No: 11

Given:

  1. class Alligator {

  2. public static void main(String[] args) { 3. int []x[] = {{1,2}, {3,4,5}, {6,7,8,9}};

4. int [][]y = x;

  1. System.out.println(y[2][1]); 6. }

    7. }

    What is the result?

    1. 2

    2. 3

    3. 4

    4. 6

    5. 7

    6. Compilation fails.

Answer: E

Question No: 12

Given:

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

  2. Object obj = new int[] { 1, 2, 3 };

  3. int[] someArray = (int[])obj;

  4. for (int i : someArray) System.out.print(i quot; quot;);

15. }

What is the result?

A. 1 2 3

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

  2. Compilation fails because of an error in line 13.

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

  4. A ClassCastException is thrown at runtime.

Answer: A

Question No: 13

Given:

11. public interface A { public void m1(); } 12.

  1. class B implements A { }

  2. class C implements A { public void m1() { } }

  3. class D implements A { public void m1(int x) { } }

  4. abstract class E implements A { }

  5. abstract class F implements A { public void m1() { } }

  6. abstract class G implements A { public void m1(int x) { } } What is the result?

  1. Compilation succeeds.

  2. Exactly one class does NOT compile.

  3. Exactly two classes do NOT compile.

  4. Exactly four classes do NOT compile.

  5. Exactly three classes do NOT compile.

Answer: C

Question No: 14

Given:

  1. abstract class C1 {

  2. public C1() { System.out.print(1); }

23. }

  1. class C2 extends C1 {

  2. public C2() { System.out.print(2); }

26. }

  1. class C3 extends C2 {

  2. public C3() { System.out.println(3); }

29. }

  1. public class Ctest {

  2. public static void main(String[] a) { new C3(); }

32. }

What is the result?

  1. 3

  2. 23

  3. 32 D. 123 E. 321

  1. Compilation fails.

  2. An exception is thrown at runtime.

    Answer: D

    Question No: 15

    Given:

    1. public class A {

    2. public void doit() { 3. }

  1. public String doit() {

  2. return quot;aquot;; 6. }

  1. public double doit(int x) {

  2. return 1.0; 9. }

    10. }

    What is the result?

    1. An exception is thrown at runtime.

    2. Compilation fails because of an error in line 7.

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

    4. Compilation succeeds and no runtime errors with class A occur.

      Answer: C

      Question No: 16

      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: 17

Given:

  1. String test = quot;Test A. Test B. Test C.quot;;

  2. // insert code here

  3. String[] result = test.split(regex);

Which regular expression, inserted at line 12, correctly splits test into quot;Test Aquot;, quot;Test Bquot;, and quot;Test Cquot;?

  1. String regex = quot;quot;;

  2. String regex = quot; quot;;

  3. String regex = quot;.*quot;;

  4. String regex = quot;\\squot;;

  5. String regex = quot;\\.\\s*quot;;

  6. String regex = quot;\\w[ \.] quot;;

    Answer: E

    Question No: 18

    Given that the current directory is empty, and that the user has read and write privileges to the current directory, and the following:

    1. import java.io.*;

    2. public class Maker {

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

    4. File dir = new File(quot;dirquot;);

    5. File f = new File(dir, quot;fquot;); 6. }

      7. }

      Which statement is true?

      1. Compilation fails.

      2. Nothing is added to the file system.

      3. Only a new file is created on the file system.

      4. Only a new directory is created on the file system.

      5. Both a new file and a new directory are created on the file system.

Answer: B

Question No: 19

Given:

22. StringBuilder sb1 = new StringBuilder(quot;123quot;);

23. String s1 = quot;123quot;;

  1. // insert code here

  2. System.out.println(sb1 quot; quot; s1);

Which code fragment, inserted at line 24, outputs quot;123abc 123abcquot;?

  1. sb1.append(quot;abcquot;); s1.append(quot;abcquot;);

  2. sb1.append(quot;abcquot;); s1.concat(quot;abcquot;);

  3. sb1.concat(quot;abcquot;); s1.append(quot;abcquot;);

  4. sb1.concat(quot;abcquot;); s1.concat(quot;abcquot;);

  5. sb1.append(quot;abcquot;); s1 = s1.concat(quot;abcquot;);

  6. sb1.concat(quot;abcquot;); s1 = s1.concat(quot;abcquot;);

  7. sb1.append(quot;abcquot;); s1 = s1 s1.concat(quot;abcquot;);

  8. sb1.concat(quot;abcquot;); s1 = s1 s1.concat(quot;abcquot;);

Answer: E

Question No: 20

Given:

  1. import java.util.Date;

  2. import java.text.DateFormat;

  1. DateFormat df

  2. Date date = new Date();

  3. // insert code here

  4. String s = df.format(date);

Which code fragment, inserted at line 23, allows the code to compile?

  1. df = new DateFormat();

  2. df = Date.getFormat();

  3. df = date.getFormat();

  4. df = DateFormat.getFormat();

  5. df = DateFormat.getInstance();

Answer: E

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

Add a Comment

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.