Core Java Technology Section Index
What is NIO.2?
Part of the OpenJDK project, NIO.2 adds new I/O capabilities designed to simplify Java application development.
What is Project Coin (JSR 334)?
Project Coin refers to a number of small changes to the Java language that were included in JDK 7.
What is InvokeDynamic (JSR 292)?
New in Java 7, JSR 292 allows dynamic languages to run faster in the JVM than in previous JDK versions.
What are the new features in Java 7?
Here are the major language changes in JDK7.
What is the Fork/Join framework (JSR 166y)?
The fork/join framework in Java 7 allows developers to take advantage of multiple processors.
How do I split a space or comma-separated list?
The split() method of String takes a regular expression. The pattern "[s,]+" should to the trick. It says the separator will be one or more white space characters or comma.
How can the following throw a NullPointerException?
How can the following throw a NullPointerException?
Integer i = ...;
int j = i;
What is a Deque?
A Deque is a double ended queue, allowing inserting and removing from both ends.
What is a magic number?
Magic numbers are literal numeric constants, typically stuck in the middle of code with no obvious reason for existance. Instead of using magic numbers, they should be declared as constants (priva...more
What is the klist tool that comes with the JDK?
The klist command-line tool is for Kerberos ticket management. Specifically, it is used to list entries in the credential cache and key table.
What is the ktab tool that comes with the JDK?
The ktab command-line tool is for Kerberos ticket management. Specifically, it is used to help manage entires in the key table. Solaris users can also use the kadmin tool (that isn't part of the J...more
What purpose does the newSetFromMap() method offer if I can just create something like a HashSet instead of a HashMap?
The Set returned by newSetFromMap() functions with the same ordering and concurrency characteristics of the map it is based off of. Some Map implementations also have a related Set implement, so u...more
Why should all Comparators be Serializable?
If you pass a Comparator that doesn't implement Serializable into a collection like a TreeMap, that collection will automatically be non-serializable. It is best to flag all Comparator implementat...more
Is there a way to read all the items out of an NIO Buffer into an array to pass onto JNI (or for some other purpose)?
The Buffer class has an array() method added in 1.6 that allows you to get the backing buffer in a single call. This can be passed on to native code or to some method that requires an array to wor...more
What's the difference between a BufferOverflowException and BufferUnderflowException?
A BufferOverflowException happens when the target buffer is full and you try to put something into it. A BufferUnderflowException happens when the source buffer is empty and you try to get somethi...more