AllExam Dumps

DUMPS, FREE DUMPS, VCP5 DUMPS| VMWARE DUMPS, VCP DUMPS, VCP4 DUMPS, VCAP DUMPS, VCDX DUMPS, CISCO DUMPS, CCNA, CCNA DUMPS, CCNP DUMPS, CCIE DUMPS, ITIL, EXIN DUMPS,


READ Free Dumps For Oracle- 1z0-804





Question ID 21445

Which statement declares a generic class?

Option A

public class Example < T > { }

Option B

public class <Example> { }

Option C

public class Example <> { }

Option D

public class Example (Generic) { }

Option E

public class Example (G) { }

Option F

public class Example { }

Correct Answer A
Explanation Explanation: Example: public class Pocket { private T value; public Pocket() {} public Pocket( T value ) { this.value = value; } public void set( T value ) { this.value = value; } public T get() { return value; } public boolean isEmpty() { return value != null; } public void empty() { value = null; } }


Question ID 21446

Given:
Deque <String> myDeque = new ArrayDeque<String>();
myDeque.push("one");
myDeque.push("two");
myDeque.push("three");
System.out.println(myDeque.pop());
What is the result?

Option A

Three

Option B

One

Option C

Compilation fails.

Option D

The program runs, but prints no output.

Correct Answer A
Explanation 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 is possible to do so immediately without violating capacity restrictions, returning true upon success and throwing an 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 first element 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