首页 > 其他 > 详细

20190927

时间:2019-09-27 19:54:26      阅读:95      评论:0      收藏:0      [点我收藏+]

1.

import java.util.Scanner;

public class T {
    public static void main(String[] args) {
        long c = 0;
        long i = 0;
        long x = 1;
        Scanner ipt = new Scanner(System.in);
        System.out.println("Please enter the amount");
        c = ipt.nextInt();
        ipt.nextLine();
        for (i = 0; i < c; i++) {
            x = (2147483647 * x + 0) % 16807;
            System.out.printf("%d Random is %d\n", i + 1, x);
        }
        ipt.close();
    }
}

技术分享图片

 

 2.Java里也有重载,通过方法名相同参数不同,同时,返回值的参数不同不能作为重载的判断条件。System.out.println()方法是System类中的一个方法,也进行了重载来应对参数为String类、boolean型等情况。

20190927

原文:https://www.cnblogs.com/minadukirinno/p/11599770.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!