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
Q

Analogous to HashTable, but with safe concurrent access and updates. What is the name of this concurrent collection class?

A

ConcurrentHashMap

26
Q

Analogous to TreeMap, but with safe concurrent access and updates. What is the name of this concurrent collection class?

A

ConcurrentSkipListMap

27
Q

Analogous to TreeSet, but with safe concurrent access and updates. What is the name of this concurrent collection class?

A

ConcurrentSkipListSet

28
Q

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?

A

CopyOnWriteArrayList

29
Q

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?

A

CopyOnWriteArraySet

30
Q

Which BasicFileAttributeView subinterface supports the attributes group and permissions?

A

PosixFileAttributeView

31
Q

In class inheritance, which term describes the unique implementation of a superclass method in a subclass?

A

polymorphism

32
Q

Which Console method ensures secure entry by suppressing the echo of characters and returning a char array that can be overwritten?

A

readPassword

33
Q

What is another term for request-forwarding in a composition relationship?

A

method delegation

34
Q

Which isolation level uses a shared locking mechanism that only prevents access to uncommitted values?

A

TRANSACTION_READ_COMMITTED

35
Q

Which class provides the best performance when generating random numbers in a multi-threaded application?

A

ThreadLocalRandom

36
Q

Which method of the BufferedReader class ignores and discards a specified number of characters?

A

skip

37
Q

Which keyword is used to implement abstract members of an abstract class?

A

extends

38
Q

Which exception is thrown when an assert statement evaluates to false?

A

AssertionError

39
Q

In a glob pattern, what does the asterisk character match?

A

Zero or more characters.

40
Q

Which FileVisitResult value, when returned from the preVisitDirectory method, will visit file and directory entries?

A

CONTINUE

41
Q

Which method does the Enum class provide to iterate through enumeration constants?

A

values

42
Q

In which pattern is a data-related class is concerned only with storage and read/write access to its instance members?

A

TransferObject TO

43
Q

Which FileVisitor method is invoked for each file when it is visited?

A

visitFile

44
Q

Which String method accepts a regular expression and replacement string for each match, and returns a manipulated string?

A

replaceAll

45
Q

Which type determines the version of a hidden member to use without polymoprhism?

A

the reference type

46
Q

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

A

Millisecond

47
Q

What SimpleDataFormat letter is used to represent -
Seconds?
Milliseconds?

A
s = seconds
S = milliseconds
48
Q

What does the phrase covariant return types describe?

A

An overriding method can return a subtype of the return type of the overridden method.