[Free] 2018(Mar) EnsurePass Passguide Oracle 1z0-809 Dumps with VCE and PDF 1-10

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

Java SE 8 Programmer II

Question No: 1

Which two statements are true for a two-dimensional array of primitive data type?

  1. It cannot contain elements of different types.

  2. The length of each dimension must be the same.

  3. At the declaration time, the number of elements of the array in each dimension must be specified.

  4. All methods of the class object may be invoked on the two-dimensional array.

Answer: C,D

Explanation: http://stackoverflow.com/questions/12806739/is-an-array-a-primitive-type-or- an-object-or-something-else-entirely

Question No: 2

Given the fragments:

Ensurepass 2018 PDF and VCE

Which line causes a compilation error?

  1. Line n1

  2. Line n2

  3. Line n3

  4. Line n4

Answer: A

Question No: 3

Given the code fragment:

Listlt;Stringgt; listVal = Arrays.asList(“Joe”, “Paul”, “Alice”, “Tom”); System.out.println (

// line n1

);

Which code fragment, when inserted at line n1, enables the code to print the count of string elements whose length is greater than three?

  1. listVal.stream().filter(x -gt; x.length()gt;3).count()

  2. listVal.stream().map(x -gt; x.length()gt;3).count()

  3. listVal.stream().peek(x -gt; x.length()gt;3).count().get()

  4. listVal.stream().filter(x -gt; x.length()gt;3).mapToInt(x -gt; x).count()

Answer: C

Question No: 4

Given:

  1. abstract class Shape {

  2. Shape ( ) { System.out.println (“Shape”); }

  3. protected void area ( ) { System.out.println (“Shape”); } 4. }

5.

  1. class Square extends Shape {

  2. int side;

  3. Square int side { 9./* insert code here */

10. this.side = side;

11. }

12. public void area ( ) { System.out.println (“Square”); }

13. }

  1. class Rectangle extends Square {

  2. int len, br;

  3. Rectangle (int x, int y) {

  4. /* insert code here */

  5. len = x, br = y;

19. }

  1. void area ( ) { System.out.println (“Rectangle”); }

    21. }

    Which two modifications enable the code to compile?

    1. At line 1, remove abstract

    2. At line 9, insert super ( );

    3. At line 12, remove public

    4. At line 17, insert super (x);

    5. At line 17, insert super (); super.side = x;

    6. At line 20, use public void area ( ) {

Answer: C,D

Question No: 5

Which two are Java Exception classes?

  1. SercurityException

  2. DuplicatePathException

  3. IllegalArgumentException

  4. TooManyArgumentsException

Answer: A,C

Question No: 6

Given the code fragments:

class TechName { String techName;

TechName (String techName) { this.techName=techName;

}

}

and

Listlt;TechNamegt; tech = Arrays.asList ( new TechName(“Java-“),

new TechName(“Oracle DB-“), new TechName(“J2EE-“)

);

Streamlt;TechNamegt; stre = tech.stream();

//line n1

Which should be inserted at line n1 to print Java-Oracle DB-J2EE-?

  1. stre.forEach(System.out::print);

  2. stre.map(a-gt; a.techName).forEach(System.out::print);

  3. stre.map(a-gt; a).forEachOrdered(System.out::print);

  4. stre.forEachOrdered(System.out::print);

Answer: C

Question No: 7

Given the definition of the Vehicle class:

class Vehicle { String name;

void setName (String name) { this.name = name;

}

String getName() { return name;

}

}

Which action encapsulates the Vehicle class?

  1. Make the Vehicle class public.

  2. Make the name variable public.

  3. Make the setName method public.

  4. Make the name variable private.

  5. Make the setName method private.

  6. Make the getName method private.

Answer: B

Question No: 8

Given the code fragment:

Listlt;Stringgt; empDetails = Arrays.asList(“100, Robin, HR”,

“200, Mary, AdminServices”,

“101, Peter, HR”);

empDetails.stream()

.filter(s-gt; s.contains(“1”))

.sorted()

.forEach(System.out::println); //line n1 What is the result?

  1. 100, Robin, HR 101, Peter, HR

  2. E. A compilation error occurs at line n1.

  3. 100, Robin, HR 101, Peter, HR

    200, Mary, AdminServices

  4. 100, Robin, HR

200, Mary, AdminServices

101, Peter, HR

Answer: C

Question No: 9

Given:

Ensurepass 2018 PDF and VCE

What is the result?

  1. The program prints nothing

  2. d

  3. A StringIndexOutOfBoundsException is thrown at runtime.

  4. AnArrayIndexOutOfBoundsException is thrown at runtime.

  5. A NullPointerException is thrown at runtime.

Answer: C

Question No: 10

Given:

public class Foolt;K, Vgt; { private K key;

private V value;

public Foo (K key, V value) (this.key = key; this value = value;)

public static lt;Tgt; Foolt;T, Tgt; twice (T value) (return new Foolt;T, Tgt; (value, value); ) public K getKey () (return key;)

public V getValue () (return value;)

}

Which option fails?

  1. Foolt;String, Integergt; mark = new Foolt;String, Integergt; (“Steve”, 100);

  2. Foolt;String, Stringgt; pair = Foo.lt;Stringgt;twice (“Hello World!”);

  3. Foolt;?, ?gt; percentage = new Foo lt;gt; (97, 32);

  4. Foolt;String, Stringgt; grade = new Foo lt;gt; (“John”, “A”);

    Answer: C

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