Java一些基本帮助类

Scanner sc=new Scanner(System.in);

sc.nextInt();

sc.next();

Random ran=new Random();

ran.nextInt();

左闭右开:ran.nextInt(1,10);得到1~9

ArrayList

泛型必须是引用类型,不能是基本数据类型,如果要存储基本类型,需要对应的包装类

猜你喜欢

转载自www.cnblogs.com/LJP-JumpAndFly/p/10426491.html