The following quiz answers cites The Java SE 6
Platform Quiz:
1. What scripting language can you use in the Java SE 6 platform?
Answer (E): The Mozilla
Rhino engine implements the JavaScript technology
scripting language and is available in the core Java Runtime Environment (JRE).
However, the scripting API allows you to use any scripting engine that conforms
with JSR 223.2. What is the normalization of Unicode text?
Answer (C):
The Java SE 6 platform provides the publicjava.text.Normalizer
class, which allows you to convert text data to common composed or decomposed
forms, allowing for accurate comparisons and searches on text. Before the Java
SE 6 platform release, theNormalizerclass had been hidden in the
Java platform. The class is now a public API.3. How do you launch your host’s default browser to view a specific
URL?
Answer (B): The Desktop
API allows your program to launch applications associated with certain file
types on the host platform. The current implementation can launch a web browser,
text editor, and email application.4. How can I sort
JTablecontent?
Answer
(D): Ajavax.swing.table.TableRowSorterwraps your existingTableModel. You can configure it to filter or sort yourJTablecontents.5. What is the correct annotation to use to export a method as a web
service operation using Java API for XML Web Services (JAX-WS), version
2.0?
Answer (B): The@WebMethodannotation is used to
mark a method that is exposed as a web service operation. Note that the@WebServiceannotation is used to specify that the class is a web
service or that the interface defines a web service. The programmer will likely
use the@WebServiceannotation in conjunction with the@WebMethodannotation. See the article “Introducing
JAX-WS 2.0 With the Java SE 6 Platform, Part 1” for more information.6. In JDK 6, the JMX Monitor API now uses a thread pool to increase
performance. What is the purpose of the JMX Monitor API?
Answer (D):
The JMX
Monitor API allows an application to sample an attribute property of an
MBean periodically and send a notification event if it passes a given threshold.
It now uses a thread pool instead of creating a thread for each monitor. Another
improvement is the ability to monitor a value within a complex type.7. JDK 6 incorporates an advanced version of the
SwingWorkerclass into core Java technology. What is the purpose of
theSwingWorkerclass?
Answer (D): Since the 1998
publication ofSwingWorkerin the article “Threads
and Swing,” developers have continuously requested that it be moved into
core. At the 2004 JavaOne conference, the Desktop team presented a new version
ofSwingWorkerthat included generification, use of the concurrency
package, andPropertyChangeListenersupport. Much of this
functionality assists with interthread communication. The Java SE 6 platform
release incorporates a similar version ofSwingWorker
that greatly assists developers in processing GUI-driven functionality off the
event-dispatching thread, indicating status and progress and aggregating the
results.8. What is the best Java platform to use with the upcoming release of
the Microsoft Windows Vista operating system?
Answer (A): The Java
SE 6 platform release works best with the latest user interface (UI)
enhancements of Windows Vista. According to a recent blog entry by Chet Haase: “The
primary delivery of Java for Vista is Java SE 6; that release has received most
of our focus during the Vista beta release timeframe.” Go to the JDK 6 Project site to download the most
recent version. The release is pretty close to final, so it is working very well
at this point. All of the serious Windows Vista problems have been fixed in this
release for months, so it is a particularly good test vehicle for Java
technology on Vista.9. In the Java SE 6 platform, what key tuning option(s) are needed to
achieve high performance?
Answer (D): See the blog entry “No Tuning
Required: Java SE Out-of-Box Vs. Tuned Performance” for a comparison of
out-of-box and hand-tuned performance.10. The Java SE 6 platform delivers a technology that can greatly
improve performance by reducing unnecessary synchronization overhead. It allows
a thread to lock and unlock an object with minimal use of atomic operations.
What is this technology called?
Answer (B): The technique called
store-free biased locking eliminates all synchronization-related atomic
operations on uncontended object monitors. The technique supports the bulk
transfer of object ownership from one thread to another, and the selective
disabling of the optimization where unprofitable, using epoch-based bulk
rebiasing and revocation. It has been implemented in the production version of
the Java HotSpot virtual machine (VM) and has yielded significant performance
improvements on a range of benchmarks and applications.

No comments:
Post a Comment