动手动脑1
随机生成1000个随机数
public class Main { static int x=1; public static void f(int count) { for(int i=0;i<count;i++) { x=(16807 * x + 1) % Integer.MAX_VALUE; System.out.println(x); } } public static void main (String[] args) { int count=1000; f(count); } }
动手动脑2
函数重载
public class Main { public static void main(String[] args) { System.out.println("The square of integer 7 is "+square(7)); System.out.println("The square of double 7 is "+square(7.5)); } public static int square(int x){ return x*x; } public static double square(double x){ return x*x; } }
标签:square,int,double,System,public,二十三日,static,九月 From: https://www.cnblogs.com/youxiandechilun/p/17723514.html