java.lang
看看wiki关于java.lang包的描述:
The Java package java.lang contains fundamental classes and interfaces closely tied to the language and runtime system. This includes the root classes that form the class hierarchy, types tied to the language definition, basic exceptions, math functions, threading, security functions, as well as some information on the underlying native system. This package contains 22 of 32 Error classes provided in JDK 6.
The main classes and interfaces in java.lang are:
Object– the class that is the root of every class hierarchy.Enum– the base class for enumeration classes (as of J2SE 5.0).Class– the class that is the root of the Java reflection system.Throwable– the class that is the base class of the exception class hierarchy.Error,Exception, andRuntimeException– the base classes for each exception type.Thread– the class that allows operations on threads.String– the class for strings and string literals.StringBufferandStringBuilder– classes for performing string manipulation (StringBuilderas of J2SE 5.0).Comparable– the interface that allows generic comparison and ordering of objects (as of J2SE 1.2).Iterable– the interface that allows generic iteration using the enhancedforloop (as of J2SE 5.0).ClassLoader,Process,Runtime,SecurityManager, andSystem– classes that provide "system operations" that manage the dynamic loading of classes, creation of external processes, host environment inquiries such as the time of day, and enforcement of security policies.MathandStrictMath– classes that provide basic math functions such as sine, cosine, and square root (StrictMathas of J2SE 1.3).- The primitive wrapper classes that encapsulate primitive types as objects.
- The basic exception classes thrown for language-level and other common exceptions.
Classes in java.lang are automatically imported into every source file.
1) Object 1
2) String 1
3) AbstractStringBuilder 1
4) StringBuffer 1
5) StringBuilder 1
6) Boolean 2
7) Byte 2
8) Double 2
9) Float 2
10) Integer 2
11) Long 2
12) Short 2
13) Thread 2
14) ThreadLocal 2
15) Enum 3
16) Throwable 3
17) Error 3
18) Exception 3
19) Class 4
20) ClassLoader 4
21) Compiler 4
22) System 4
23) Package 4
24) Void 4

浙公网安备 33010602011771号