[Free] 2018(Jan) EnsurePass Examcollection Oracle 1z0-804 Dumps with VCE and PDF 31-40

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

Java SE 7 Programmer II

Question No: 31

Given:

Ensurepass 2018 PDF and VCE

What is the result?

  1. Three

  2. One

  3. Compilation fails.

  4. The program runs, but prints no output.

Answer: A Explanation: push

void push(E e)

Pushes an element onto the stack represented by this deque (in other words, at the head of this deque) if it ispossible to do so immediately without violating capacity restrictions, returning true upon success and throwingan IllegalStateException if no space is currently available.

This method is equivalent to addFirst(E). pop

E pop()

Pops an element from the stack represented by this deque. In other words, removes and returns the firstelement of this deque.

This method is equivalent to removeFirst(). Returns:

the element at the front of this deque (which is the top of the stack represented by this deque)

Throws:

NoSuchElementException – if this deque is empty

Question No: 32

Given the following code fragment:

Ensurepass 2018 PDF and VCE

What is the result?

  1. Three

  2. One

  3. Compilation fails

  4. The program runs, but prints no outout

Answer: B Explanation:

add

boolean add(E e)

Inserts the specified element into the queue represented by this deque (in other words, at the tail of thisdeque) if it is possible to do so immediately without violating capacity restrictions, returning true uponsuccess and throwing an IllegalStateException if no space is currently available. When using acapacity-restricted deque, it is generally preferable to use offer.

This method is equivalent to addLast(E). remove

E remove()

Retrieves and removes the head of the queue represented by this deque (in other words, the first element ofThisdeque). This method differs from poll only in that it throws an exception if this deque is empty.

This method is equivalent to removeFirst(). Returns:

Thehead of the queue represented by this deque Class ArrayDeque

Question No: 33

Which concept allows generic collections to interoperate with java code that defines collections that use rawtypes?

  1. bytecode manipulation

  2. casting

  3. autoboxing

  4. auto-unboxing

  5. type erasure

Answer: E Explanation:

The type erasure of its leftmost bound, or type Object if no bound was specified. Examples:

type parameters type erasure Listlt;Stringgt; List Map.Entrylt;String,Longgt; Map.Entry

lt;T extends Cloneable amp; Comparablelt;Tgt;gt; Cloneable

lt;T extends Object amp; Comparablelt;Tgt;gt; Object

lt;Tgt; T[] toArray(T[] a) Object[] toArray(Object[] a)

The type erasure process can be imagined as a translation from generic Java source code back into regularJava code. In reality the compiler is more efficient and translates directly to Java byte code. But the byte codecreated is equivalent to the non-generic Java code.

Question No: 34

Given:

Ensurepass 2018 PDF and VCE

What is the result?

  1. 5

  2. 6

  3. An exception is thrown at runtime

  4. Compilation fails due to an error on line 6

  5. Compilation fails due to an error on line 7

Answer: C Explanation:

The code compile fine but java.lang.NullPointerException is thrown at runtime. x has no value. The code would run if line 2 was changed to:

Integer x = 3;

Question No: 35

Given:

Ensurepass 2018 PDF and VCE

What is the result?

  1. p001 Widget

    p002 X-Large Widget

  2. p002 Large Widget p001 Widget

  3. p002 X-large Widget p001 Widget

  4. p001 Widget p002 Large Widget

  5. compilation fails

Answer: A

Explanation: Compiles fine. Output is: P001 Widget

P002 X-Large Widget

Line: partList.put(quot;P002quot;, quot;X-Large Widgetquot;); gt;gt; overwrites gt;gt; line:partList.put(quot;P002quot;, quot;Large Widgetquot;);

put

V put(K key, V value)

Associates the specified value with the specified key in this map (optional operation). If the map previouslycontained a mapping for the key, the old value is replaced by the specified

value. (Amap m is said to contain amapping for a key k if and only if m.containsKey(k) would return true.)

Parameters:

key – key with which the specified value is to be associated value – value to be associated with the specified key

Returnsthe previous value associated with key, or null if there was no mapping for key. (A null return can alsoindicate that the map previously associated null with key, if the implementation supports null values.)

Question No: 36

Given:

Ensurepass 2018 PDF and VCE

What is the result?

  1. John Adams George Washington Thomas Jefferson

  2. George Washington John Adams

    Thomas Jefferson

  3. Thomas Jefferson John Adams

    George Washington

  4. An exception is thrown at runtime

  5. Compilation fails

Answer: B

Explanation: The program compiles and runs fine.

At runtime the NameList is built and then sorted by natural Order (String gt;gt; alphabetically).

Question No: 37

Given:

Ensurepass 2018 PDF and VCE

What is the result?

  1. An exception is thrown at runtime on line 9.

  2. An exception is thrown at runtime on line 12

  3. onetwonull

  4. onetwothree

  5. twoonenull

  6. threetwoone

Answer: D Explanation: addFirst

void addFirst(E e)

Inserts the specified element at the front of this deque if it is possible to do so immediately without violating

capacity restrictions. When using a capacity-restricted deque, it is generally preferable to use method offerFirst

(E).

pollLast

E pollLast()

Retrieves and removes the last element of this deque, or returns null if this deque is empty. Returns:

the tail of this deque, or null if this deque is empty

Question No: 38

Given the class?

Ensurepass 2018 PDF and VCE

What is the result?

  1. Jane Doe John Doe Joe Shmoe

  2. John Doe Jane Doe Joe Shmoe

  3. Joe Shmoe John Doe

    Jane Doe

  4. Joe Shmoe Jane Doe John Doe

  5. Jane Doe Joe Shmoe John Doe

  6. John Doe Joe Shmoe Jane Doe

Answer: A

Explanation: The list will be sorted alphabetically (Lastname / Firstname). first sorted by Lastname

if Lastname equals, sorted by firstname Output will be:

Jane Doe John Doe Joe Shmoe

Question No: 39

Given the cache class:

Ensurepass 2018 PDF and VCE

A. 101

  1. Compilation fails at line 1.

  2. Compilation fails at line 2.

  3. Compilation fails at line 3.

Answer: B Explanation:

Compilation failure at line:1

Incorrect number of arguments for type Cachelt;Tgt;; it cannot be parameterized with arguments lt;gt;illegal start of typetype cache.Cache does not take parameters.

Question No: 40

Given:

Ensurepass 2018 PDF and VCE

What is the result?

  1. John-.-George-.-Paul-.-Ringo

  2. John George Paul Ringo

  3. John – George – Paul – Ringo –

  4. An exception is thrown at runtime

  5. Compilation fails

Answer: B Explanation:

The split() method is used to split a string into an array of substrings, and returns the new array.

regex: – followed by two characters

100% Ensurepass Free Download!
Download Free Demo:1z0-804 Demo PDF
100% Ensurepass Free Guaranteed!
Download 2018 EnsurePass 1z0-804 Full Exam PDF and VCE

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 Comment

(0 Comments)

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