举个例子,如下: class CA<T>{ public T getVal(){ return null; } } interface IA{} interface IB{} public class Test10<T extends CA<? extends Number>&IA&IB>{ public void t(T t){ Number b = t.getVal(); } } 当分析t.getVal()表达式时,调用visitClassType(…
通过每块代码进行源码解读,并发现源码使用的技术栈,扩展视野. 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…
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…
总体阅读了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…
/** Access codes for dereferencing(解引用), assignment, * and pre/post increment/decrement. * Access codes for assignment operations are determined * by method accessCode below. * * All access codes for accesses to the current class are even. 都是偶数 * If…