General Java Questions II
Answer: See JavaHelp at
http://www.javasoft.com/products/javahelp/
you create HTML pages for the main text, and add some XML files for a hierarchical
table of contents and a map from TOC tags to relative URLs giving document
locations.
What is a Just In Time(JIT) compiler?
Answer: It is a JVM that compiles Java instructions (called bytecode) into native
machine instructions at run time and then uses this compiled native code when the
corresponding Java code is needed. This eliminates the constant overhead of
interpretation which tradition first generation JVM s used.
Dave Lee
Is there a collection object like the hashmap or hashtable that stores values in an
ordered path? Vector does this but i need the key/value functionality. hashmaps do
not guarantee the order of the objects.
Answer: Take a look at java.util.TreeMap.
Red Black tree based implementation of the SortedMap interface. This class
guarantees that the map will be in ascending key order, sorted according to the
natural order for the key s class (see Comparable), or by the comparator provided at
creation time, depending on which constructor is used.
Note that this implementation is not synchronized. If multiple threads access a map
concurrently, and at least one of the threads modifies the map structurally, it must be
synchronized externally.
Most people asked why there is an error, but my question is why this is NOT an
error
Please take a look:
r is a number and s is a character, why can I put them together to make a comparison
without compilation error? Could somebody tell me... thank you
double r = 34.5;
char s = c ;
if (r > s) {
System.out.println("r > s");
} else {
System.out.println("r < s");
}
Answer1: char is considered to be an arithmetic type, acting as a 16 bit unsigned
integer.
Conversions among the primitive types are divided into three categories:
identity, widening, and narrowing. The identity conversions are the trivial ones like
char to char. The widening conversions all have the effect of preserving the
approximate magnitude of the result, even if it cannot be represented exactly in the
new type. The narrowing conversions are the remaining conversions that may
destroy the magnitude information.
Identity and widening conversions can be inserted automatically by the compiler.
file:///F|/a_jsite/350_tips/general_java II.htm (7 of 14) [2001 07 08 11:24:53]
footer
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved