1, the basic type of the corresponding object types: We know the basic types in Java: void byte char double float integer long short
The corresponding object types, respectively: Void Byte Character Double Float Integer Long Short, In fact, these classes have a final member of the type of basic types, such as
Byte class members inside private final byte value, since its members are final, so a Byte only in its beginning when the specified value of its after immutable.
Achieved in the corresponding object type in the basic type is implemented by native (Class <Byte>) Class.getPrimitiveClass ("byte") to get the.
What is interesting is: In the JDK1.5 after the object type in the inside of each cache -128 - 127 corresponding to the object type, just call their troops under the static method valueOf (byte b) (cache only the method used), If the scope of its parameters provided in the context of the cache, but no
New Byte () but from the cache to obtain pre-New's Byte.
2, as all objects of "ancestor", Object class has a number of important ways, such as getClass hashCode clone notify notifyAll wait methods are native to. So you call these methods at the time should know that you call the virtual machine-level native application.
3, Class class, in Java, including basic data types such as int in fact is a Class is a Class, in reflection of this class are a large number of applications, in fact, the importance of its internal methods such as: forName isInstance isArray isPrimitive getName getSimpleName getDeclaredFields getDeclaredMethods getDeclaredConstructors
Are native, ie the virtual class level has achieved these things. Why does Java support for reflection, in fact, that white is the existence of this Class, each class has its corresponding metadata existence, JVM metadata information in the native way to get through. In fact, it plainly is also reflected as the legendary so well, if I come to realize the KAVA language based on JAVA virtual machine
(Assuming the conditions set up), then I will compile some of this class during the description of the information, if the number of field ah, ah field names etc. I use java stored into a data structure to achieve, and then KAVA by calling JAVA program to get that information, in fact, with the reflection that the same reason.
4, the String, String within a matter of fact is final char , because it is final, so if you want to change its internal character, may create a new String. If you want to create a new string object but want to make changes have to use JDK1.5 after a class StringBuilder, this class so neglected thread synchronization is more efficient than StringBuffer. Also on the String does not mention is similar to the String a = "abc"; String b = "abc"; the practice, as "abc" already did during compilation, so
JVM will keep a copy of "abc", it simply is not a very deep stuff, any one of the students learned compiler theory know that this is any compiler optimization must be done. String know the "wheels" of the bottom after you regret you write in more than a large number of applications N String add procedures?
If these characters have a way around it in order that replaced StringBuilder.append. As for the String.format method has been tested even less efficient adding strings.
5, some important basic interfaces such as Cloneable Comparable Iterable, Readable Runnable, thanks to the power of programming to interfaces, implementation under a N-ah
6, a number of predefined annotation such as: Deprecated Override SuppressWarnings the mark of 1.5 is the future of programming when applied.
7, and thread the Thread ThreadGroup that main method is native to. There is also a ThreadLocal in fact not a novel, just so that different threads of different backup operations, operating systems theory there.
8, and mathematics-related Math StrictMath are all static methods of use, mainly used for data calculation.
9, Enum was added after the 1.5 are quite useful, in fact, is only maintained its internal name and the order of enumeration, such as enum A (BOY, GIRL), is it actually BOY name, its order 1 (maybe 0), GIRL is name, the order of 2 (probably 1);
This class can not be instantiated, can only be free to build through the statement keyword enum enumeration, you can get in the program set for each enumeration, not because the API provides the interface, but because the enumeration created when the compiler will do some "hands."
10, abnormal levels of the following:
It is noteworthy that the standards set in the SUN, RuntimeException is not required to try ... catch, when you are doing a component for others to call, but do not want others to use try ... catch way to use When your component, you can throw a RuntimeException or a subclass of Exception.
11, some not commonly used, but can provide a very useful feature of class
Process and ProcessBuilder creating process, if you want to use ipconfig command parameters can be obtained through its network card
Runtime environment for running programs can get some stuff, such as the number of host CPU, memory size and other information.
System Needless to say, and can get out, in, errr flow, 1.5 after the addition of a console is used mainly to facilitate the console programming
management package can be obtained by ManagementFactory including compiler, operating system management bean to get information such as operating system architecture. But the package only contains a number of management bean interface, implementation class in com.sun.management.