zoukankan      html  css  js  c++  java
  • 课堂测试02

    一:使用Random类生成随机数
    使用当前时间微中子的Random对象
    Random r4 = new Random(System.currentTimeMillis());
            System.out.println("以当前时间为种子的Random对象");
            System.out.println("r3.nextBoolean():\t" + r4.nextBoolean());
            System.out.println("r3.nextInt():\t\t" + r4.nextInt());
            System.out.println("r3.nextDouble():\t" + r4.nextDouble());
            System.out.println("r3.nextGaussian():\t" + r4.nextGaussian());
    二:重载函数:
     同名字不同类型来分别不同函数
     (1)方法名相同;
     (2)参数类型不同,参数个数不同,或者是参数类型的顺序不同。
    三:println方法也存在着重载
     根据不同的参数类型进行重载

  • 相关阅读:
    Codeforces Global Round 6
    Codeforces Global Round 5
    笔记
    笔记
    Codeforces Round #608 (Div. 2)
    模板
    Codeforces Round #607 (Div. 2)
    find命令
    while循环脚本
    发邮件
  • 原文地址:https://www.cnblogs.com/smartisn/p/9786810.html
Copyright © 2011-2022 走看看