1Z0-804 Flashcards
Which three access modifiers are allowed for class and instance members?
public, private, protected
Which element will be retrieved from the path C:\paul\baker\java7\804.java when executing the method getName(3)?
804.java
In a format string, what does the % character specify?
beginning of a format parameter
In a glob pattern, what do the curly braces {} contain?
subpatterns that are comma delimited
In a String, which character is required to escape the initial backslash for Java?
\
Which method of the Object class determines the bucket in which an object is placed in a Hashtable?
hashCode, hashCode returns an int value.
What is the local connection string syntax for the Java DB Network Client Driver?
jdbc:derby://localhost:port/databaseName
Which superclass constructor is implicitly invoked by the compiler in a subclass that does not explicitly invoke a specific superclass constructor?
The constructor with no parameters.
Which two fields are the default values for a ResultSet object?
CONCUR_READ_ONLY and TYPE_FORWARD_ONLY
Using SimpleDateFormat class, what does the pattern letter a represent?
AM/PM marker
In a format string, what does the $ character specify?
The end of an argument location.
String.format(“%1$s %2$s %2$s %3$s”, “a”, “b”, “c”);
Which keyword provides only visibility when using shared variables across multiple threads?
volatile
Which BasicFileAttributeView subinterface supports allowing or disallowing permissions on file system objects for a specified identity other than the owner?
AclFileAttributeView
What is the thread-safe version of the Queue class found in the java.util.concurrent package?
BlockingQueue
What are the patterns supported by Glob Syntax?
<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>
What are the Concurrent Collections?
BlockingQueue (I), ArrayBlockingQueue (C),
LinkedBlockingQueue (C), DelayQueue,
PriorityBlockingQueue, SynchronousQueue,
LinkedBlockingDeque, ConcurrentHashMap,
ConcurrentSkipListMap, ConcurrentSkipListSet,
CopyOnWriteArrayList, CopyOnWriteArraySet
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?
BlockingQueue
What classes implement the concurrent collection BlockingQueue interface?
ArrayBlockingQueue, LinkedBlockingQueue, DelayQueue PriorityBlockingQueue SynchronousQueue
This class provides a fixed-size array based implementation of the BlockingQueue interface. What is the name of this concurrent collection class?
ArrayBlockingQueue
This class provides a linked list based implementation of the BlockingQueue interface. What is the name of this concurrent collection class?
LinkedBlockingQueue
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?
DelayQueue
Equivalent to java.util.PriorityQueue, but implements that BlockingQueue interface. What is the name of this concurrent collection class?
PriorityBlockingQueue
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?
SynchronousQueue
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?
LinkedBlockingQueue
Analogous to HashTable, but with safe concurrent access and updates. What is the name of this concurrent collection class?
ConcurrentHashMap
Analogous to TreeMap, but with safe concurrent access and updates. What is the name of this concurrent collection class?
ConcurrentSkipListMap
Analogous to TreeSet, but with safe concurrent access and updates. What is the name of this concurrent collection class?
ConcurrentSkipListSet
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
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
Which BasicFileAttributeView subinterface supports the attributes group and permissions?
PosixFileAttributeView
In class inheritance, which term describes the unique implementation of a superclass method in a subclass?
polymorphism
Which Console method ensures secure entry by suppressing the echo of characters and returning a char array that can be overwritten?
readPassword
What is another term for request-forwarding in a composition relationship?
method delegation
Which isolation level uses a shared locking mechanism that only prevents access to uncommitted values?
TRANSACTION_READ_COMMITTED
Which class provides the best performance when generating random numbers in a multi-threaded application?
ThreadLocalRandom
Which method of the BufferedReader class ignores and discards a specified number of characters?
skip
Which keyword is used to implement abstract members of an abstract class?
extends
Which exception is thrown when an assert statement evaluates to false?
AssertionError
In a glob pattern, what does the asterisk character match?
Zero or more characters.
Which FileVisitResult value, when returned from the preVisitDirectory method, will visit file and directory entries?
CONTINUE
Which method does the Enum class provide to iterate through enumeration constants?
values
In which pattern is a data-related class is concerned only with storage and read/write access to its instance members?
TransferObject TO
Which FileVisitor method is invoked for each file when it is visited?
visitFile
Which String method accepts a regular expression and replacement string for each match, and returns a manipulated string?
replaceAll
Which type determines the version of a hidden member to use without polymoprhism?
the reference type
Using SimpleDateFormat class, what does the pattern letter S represent?
Millisecond
What SimpleDataFormat letter is used to represent -
Seconds?
Milliseconds?
s = seconds S = milliseconds
What does the phrase covariant return types describe?
An overriding method can return a subtype of the return type of the overridden method.