Boolean源码比较简单. public final class Boolean implements java.io.Serializable, Comparable<Boolean> { /** * The {@code Boolean} object corresponding to the primitive * value {@code true}. */ public static final Boolean TRUE = new Boolean(true); /** * The…
文章来源:嗨学网 敏而好学论坛www.piaodoo.com 欢迎大家相互学习 在一次源码查看ThreadGroup的时候,看到一段代码,为以下: /* * @throws NullPointerException if the parent argument is {@code null} * @throws SecurityException if the current thread cannot create a * thread in the specified thread grou…
String类定义实现了java.io.Serializable, Comparable<String>, CharSequence 三个接口:并且为final修饰. public final class String defined String由char[]数组实现 /** The value is used for character storage. */ private final char value[]; /** Cache the hash code for the strin…
通过每块代码进行源码解读,并发现源码使用的技术栈,扩展视野. registerNatives 方法解读 /* register the natives via the static initializer. * * VM will invoke the initializeSystemClass method to complete * the initialization for this class separated from clinit. * Note that to use prop…
总体阅读了Long的源码,基本跟Integer类类似,所以特别全部贴出源码,直接注释进行理解. // final修饰符 public final class Long extends Number implements Comparable<Long> { /** * A constant holding the minimum value a {@code long} can * have, -2<sup>63</sup>. */ // 最小值-负值 @Native…
Byte 类字节,属于Number. public final class Byte extends Number implements Comparable<Byte> { /** * A constant holding the minimum value a {@code byte} can * have, -2<sup>7</sup>. */ public static final byte MIN_VALUE = -128; /** * A constant…