java.lang包作为java语言的核心语言包,是唯一一个可以不通过import语句导入而可以直接使用的java包。
 
几个关键的类包括:
一-基本数据类型对应的接口和类
Comparable接口:以下8个基本数据类型都实现了Comparable接口,此借口就一个方法public int compareTo(T o)Number类:public abstract class Number implements java.io.Serializable
Byte,Short,Integer,Long,Float,Double6个类都是该类的子类 
提供了6个方法:public abstract
abstract
abstract
abstract
                            public byte byteValue(){}
                            public short shortValue(){}
-------------------------------------------------------------------------------------------------------------------
Boolean
Byte
Character
Double
Float
Integer
Long
Short以上8个基本类型的对象类:
1、都是public final 的
2、都重写了Object类的equals()方法,可以直接用来比较对象的值
由于重写了equals()方法,所以必须重写hashCode()方法
3、由于都实现了Comparable接口,所以都有compareTo()方法    compareTo()方法实现两个字符串对象的关系,大于,等于,小于,返回值为int类型的。4、都有类似于public static long parseLong(String s)这样的将String转换为对应基本数据类型的静态方法
5、都有类似于public static Long valueOf(long l)这样的将基本数据类型转化为对应对象类型的静态方法
-------------------------------------------------------------------------------------------------------------------
二、类加载器(抽象类)
ClassLoader:定义如下
public Class<?> loadClass(String name) throws ClassNotFoundException
 
三、主线程接口和类
接口:Runnable只有一个虚函数
public interface Runnable {
abstract void run();
}类:Thread
public class Thread implements Runnable
 
四、异常处理常用类和接口
ThrowableError
ExceptionRuntimeException
ClassNotFoundException
NullPointerException
IndexOutOfBoundsException 
1 Throwable类
   是所有Error类和Exception类的基类。
   提供的方法有:
getMessage()
getLocalizedMessage()
getCause()
printStackTrace():抵达异常掷出点之前的一连串函数调用过程。
printStackTrace(PrintStream s):抵达异常掷出点之前的一连串函数调用过程。
printStackTrace(PrintWriter s):抵达异常掷出点之前的一连串函数调用过程。
fillInStackTrace()
getStackTrace()
setStackTrace(StackTraceElement[] stackTrace)
 
2 Error类
继承自Throwable,不重写Throwable类的方法,重载了多个构造方法。
 
3 Exception类
继承自Throwable,不重写Throwable类的方法,重载了多个构造方法。
 
4 RuntimeException类
继承自Exception,不重写Exception类的方法,重载了多个构造方法。
 
五、算术计算的工具类
Math(final类型)
提供了关于算术计算的诸多静态方法,如
1、三角函数
2、反三角函数
3、弧度转角度,角度转弧度(toRadians,toDegrees)
4、e的几次方(exp)
5、对数计算(log,log10)
6、取平方根(sqrt)
7、取三次方根(cbrt)
8、小数取整:floor,ceil
       这两个宝贝函数的主要任务是截掉小数以后的小数位。
        区别是: floor总是把数字变得越来越小,而ceil总是把数字变大。
        其实名字可以理解floor是地板,ceil是天花板。        如:
 
1. public class
2. public static void
3. 
4. out.println("==============Math.floor()==============");
5. out.println("Math.floor(99.1) = "
6. out.println("Math.floor(-99.1) = "
7. out.println("Math.floor(99.9) = "
8. out.println("Math.floor(99.9) = "
9.         
10. out.println("/n/n==============Math.ceil()==============");
11. out.println("Math.ceil(99.1) = "
12. out.println("Math.ceil(-99.1) = "
13. out.println("Math.ceil(99.9) = "
14. out.println("Math.ceil(99.9) = "
15.         
16.     }
17. }
18. 
19. output:
20. ==============Math.floor()==============
21. Math.floor(99.1) = 99.0
22. Math.floor(-99.1) = -100.0
23. Math.floor(99.9) = 99.0
24. Math.floor(99.9) = -100.0
25. 
26. 
27. ==============Math.ceil()==============
28. Math.ceil(99.1) = 100.0
29. Math.ceil(-99.1) = -99.0
30. Math.ceil(99.9) = 100.0
31. Math.ceil(99.9) = -99.0
 
9、两个数比较取大,取小(max,min)
10、随机数(random)
11、四舍五入(round)
12、a的b次方计算(pow)
等等......
注意:java.lang包下还有一个与之类似的类StrictMath(final类型)
 
六、系统相关工具类
System提供了3个常用的静态数据成员和若干静态方法。如:
System.in     final static
System.out   final static
System.err    final static
并提供了与这3个静态数据成员对象的静态set方法
System.setIn()
System.setOut()
System.setErr()
 
其他静态方法
System.arraycopy()    static native
System.getProperties()  若干重载方法
System.setProperties()  若干重载方法
System.clearProperty(String key)
System.exit(int status)
System.gc()
System.load(String filename)
System.loadLibrary(String libname):加载动态链接库(.dll/.os),libname是库名,不带有.dll后缀名
 
 
七、基类
Object
 
 
1. package java.lang;
2. 
3. public class
4. 
5. private static native void
6. static
7.         registerNatives();
8.     }
9. 
10. public
11. 
12. public native int
13. 
14. public
15. return (this
16.     }
17. 
18. protected
19. 
20. public
21. return getClass().getName() + "@"
22.     }
23. 
24. public final native void
25. 
26. public final native void
27. 
28. public final native void wait(long
29. 
30. public final void wait(long timeout, int
31. if
32. throw new IllegalArgumentException("timeout value is negative");
33.         }
34. 
35. if
36. throw new
37. "nanosecond timeout value out of range");
38.         }
39. 
40. if
41.         timeout++;
42.     }
43. 
44.     wait(timeout);
45.     }
46. 
47. public final void
48.     wait(0);
49.     }
50. 
51. protected void
52. }
53. 
 
wait()方法:public final/public final native
notify()方法:public final native
notifyAll()方法:public final native
以上3个方法:wait,notify,notifyAll给线程使用的,wait() 是让一个线程处于等待状态,notify()是唤醒一个线程
 
wait 就是让当前运行的代码暂停,等待通知 
notofy 就是发出一个通知,不过不知道谁能拿到这个通知哦! 
notifyAll()  就是发出一个广播,所有 wait 的都会听到这个广播通知。  
getClass()方法:public final native
hashCode()方法:public native int
在Hashtable,HashMap这类使用散列值的类里,查找的时候可以直接使用hashCode,而不必要一个的遍历,这样一来效率提高很多。
equals(),hashCode()(如果你重载了.equals(),hashCode()必须随之更改)。
a.equal(b)==true   =>   a.hashcode()==b.hashcode(),反之则未必。toString()()方法:
 
八、字符串处理相关类
String
StringBuffer请参照另外一篇博客《熟悉java.lang包-2(八、字符串处理相关类)》