1Z0-804 Flashcards

1
Q

Which three access modifiers are allowed for class and instance members?

A

public, private, protected

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which element will be retrieved from the path C:\paul\baker\java7\804.java when executing the method getName(3)?

A

804.java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In a format string, what does the % character specify?

A

beginning of a format parameter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In a glob pattern, what do the curly braces {} contain?

A

subpatterns that are comma delimited

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In a String, which character is required to escape the initial backslash for Java?

A

\

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which method of the Object class determines the bucket in which an object is placed in a Hashtable?

A

hashCode, hashCode returns an int value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the local connection string syntax for the Java DB Network Client Driver?

A

jdbc:derby://localhost:port/databaseName

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which superclass constructor is implicitly invoked by the compiler in a subclass that does not explicitly invoke a specific superclass constructor?

A

The constructor with no parameters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which two fields are the default values for a ResultSet object?

A

CONCUR_READ_ONLY and TYPE_FORWARD_ONLY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Using SimpleDateFormat class, what does the pattern letter a represent?

A

AM/PM marker

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In a format string, what does the $ character specify?

A

The end of an argument location.

String.format(“%1$s %2$s %2$s %3$s”, “a”, “b”, “c”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which keyword provides only visibility when using shared variables across multiple threads?

A

volatile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which BasicFileAttributeView subinterface supports allowing or disallowing permissions on file system objects for a specified identity other than the owner?

A

AclFileAttributeView

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the thread-safe version of the Queue class found in the java.util.concurrent package?

A

BlockingQueue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the patterns supported by Glob Syntax?

A
<code>
* - matches any string of any length, even 0 length
** - similar to * but crosses dir boundaries
? - matches any single character
[xyz] - matches letters x,y or z
[0-5] - match range
{xyz, abc}  - matches either xyz or abc
</code>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the Concurrent Collections?

A

BlockingQueue (I), ArrayBlockingQueue (C),
LinkedBlockingQueue (C), DelayQueue,
PriorityBlockingQueue, SynchronousQueue,
LinkedBlockingDeque, ConcurrentHashMap,
ConcurrentSkipListMap, ConcurrentSkipListSet,
CopyOnWriteArrayList, CopyOnWriteArraySet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

This concurrent collection interface extends the Queue interface. If the queue is empty, it waits for an element to be inserted, and if the queue is full, it waits for an element to be removed from the queue. What is the name of this interface?

A

BlockingQueue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What classes implement the concurrent collection BlockingQueue interface?

A
ArrayBlockingQueue, 
LinkedBlockingQueue, 
DelayQueue
PriorityBlockingQueue
SynchronousQueue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

This class provides a fixed-size array based implementation of the BlockingQueue interface. What is the name of this concurrent collection class?

A

ArrayBlockingQueue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

This class provides a linked list based implementation of the BlockingQueue interface. What is the name of this concurrent collection class?

A

LinkedBlockingQueue

21
Q

This class implements BlockingQueue and consists of elements that are of type Delayed. An element can only be retrieved from this queue only after its delay period. What is the name of this concurrent collection class?

A

DelayQueue

22
Q

Equivalent to java.util.PriorityQueue, but implements that BlockingQueue interface. What is the name of this concurrent collection class?

A

PriorityBlockingQueue

23
Q

This class implements BlockingQueue. In this container, each insert() by a thread waits for a corresponding remove() by another thread. What is the name of this concurrent collection class?

A

SynchronousQueue

24
Q

This class implements BlockingDeque where insert and remove operations could block; uses a linked-list for implementation. What is the name of this concurrent collection class?

A

LinkedBlockingQueue

25
Analogous to HashTable, but with safe concurrent access and updates. What is the name of this concurrent collection class?
ConcurrentHashMap
26
Analogous to TreeMap, but with safe concurrent access and updates. What is the name of this concurrent collection class?
ConcurrentSkipListMap
27
Analogous to TreeSet, but with safe concurrent access and updates. What is the name of this concurrent collection class?
ConcurrentSkipListSet
28
Similar to ArrayList, but provides safe concurrent access. When the ArrayList is update, it creates a fresh copy of the underlying array. What is the name of this concurrent collection class?
CopyOnWriteArrayList
29
A Set implementation, but provides safe concurrent access and is implemented using CopyOnWriteArrayList. When the container is updated, it creates a fresh copy of the underlying array. What is the name of this concurrent collection class?
CopyOnWriteArraySet
30
Which BasicFileAttributeView subinterface supports the attributes group and permissions?
PosixFileAttributeView
31
In class inheritance, which term describes the unique implementation of a superclass method in a subclass?
polymorphism
32
Which Console method ensures secure entry by suppressing the echo of characters and returning a char array that can be overwritten?
readPassword
33
What is another term for request-forwarding in a composition relationship?
method delegation
34
Which isolation level uses a shared locking mechanism that only prevents access to uncommitted values?
TRANSACTION_READ_COMMITTED
35
Which class provides the best performance when generating random numbers in a multi-threaded application?
ThreadLocalRandom
36
Which method of the BufferedReader class ignores and discards a specified number of characters?
skip
37
Which keyword is used to implement abstract members of an abstract class?
extends
38
Which exception is thrown when an assert statement evaluates to false?
AssertionError
39
In a glob pattern, what does the asterisk character match?
Zero or more characters.
40
Which FileVisitResult value, when returned from the preVisitDirectory method, will visit file and directory entries?
CONTINUE
41
Which method does the Enum class provide to iterate through enumeration constants?
values
42
In which pattern is a data-related class is concerned only with storage and read/write access to its instance members?
TransferObject TO
43
Which FileVisitor method is invoked for each file when it is visited?
visitFile
44
Which String method accepts a regular expression and replacement string for each match, and returns a manipulated string?
replaceAll
45
Which type determines the version of a hidden member to use without polymoprhism?
the reference type
46
Using SimpleDateFormat class, what does the pattern letter S represent?
Millisecond
47
What SimpleDataFormat letter is used to represent - Seconds? Milliseconds?
``` s = seconds S = milliseconds ```
48
What does the phrase covariant return types describe?
An overriding method can return a subtype of the return type of the overridden method.