public class Test2 { public static void main(String args[]){ int num; int count[]=new int[21]; for(int i=0;i<10000;i++){ num=(int)(Math.random()*20+0.5); //产生0到20的随机数 count[num]++; //若产生随机数是0,则用count[0]表示它的个数,数组的初始值都为0 System.out.print(num+" "…
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…
java.lang.instrument.Instrumentation 看完文档之后,我们发现这么两个接口:redefineClasses和retransformClasses.一个是重新定义class,一个是修改class.这两个大同小异,看redefineClasses的说明: This method is used to replace the definition of a class without reference to the existing class file bytes…