zoukankan      html  css  js  c++  java
  • 附作业,动手动脑……

    一、请看下面源代码,你发现了有什么特殊之处吗?

            

          他们的参数类型不同,参数名相同——方法重载!!

    二、随机整数

        a,源代码

    // RandomInt.java
    // Shifted, scaled random integers
    import javax.swing.JOptionPane;
    
    public class Random {
       public static void main( String args[] )
       {
          int value;
          String output = "";
    
          for ( int i = 1; i <= 1000; i++ ) {
             value = 1 + (int) ( Math.random() * 1000 );
             output += value + "  ";
             
             if ( i % 20 == 0 )
                output += "
    ";
          }
    
          JOptionPane.showMessageDialog( null, output,
             "20 Random Numbers from 1 to 6",
             JOptionPane.INFORMATION_MESSAGE );
    
          System.exit( 0 );
       }
    }

        b,结果

            

  • 相关阅读:
    类加载机制与jdk智能调优命令
    初认Redis
    Spring-Cloud组件eureka
    SpringBoot入门知识
    SpringCloud
    java内存模型
    Redis
    Vue
    Nginx
    Linux系统
  • 原文地址:https://www.cnblogs.com/zhaochenguang/p/7665684.html
Copyright © 2011-2022 走看看