未结

  1. 环境配置:目的是让命令行可以找到 Java环境变量配置以及为什么要配置环境变量_呆呆up的专栏-CSDN博客
  2. 新建文件夹,另存为.java
  3. 命令行:java hello(类名)
  4. public:访问控制符
  5. static:内存模型,栈,堆,静态内存
  6. 主函数的参数:字符串数组
  7. 先粘贴至记事本
  8. 重载c盘
  9. 西方,技术封锁
  10. Unicode&Ascill&UTF-8:CSDN
    1. Math常用函数:
      /** 
               *Math.sqrt()//计算根号下
               *Math.cbrt()//计算立方根
               *Math.pow(a, b)//计算a的b次方
               *Math.max( , );//计算最大值
               *Math.min( , );//计算最小值
               */  
       /** 
               * abs求绝对值 
               */  
               System.out.println(Math.abs(-10.4));    //10.4  

        

        /**
                 * ceil天花板的意思,就是返回大的值
                 */
                 System.out.println(Math.ceil(-10.1)); //-10.0
                 System.out.println(Math.ceil(10.7)); //11.0

      /**
                 * floor地板,返回小的值
                 */
                 System.out.println(Math.floor(-10.1)); //-11.0
                 System.out.println(Math.floor(10.7)); //10.0

      /**
                 * random 取得一个大于或者等于0.0小于不等于1.0的随机数
                 */
                 System.out.println(Math.random()); //大于0小于1的double类型的数
                 System.out.println(Math.random()*2);//大于0小于2的double类型的数
                 System.out.println(Math.random()*2+1);//大于1小于3的double类型的数

      /** 
               * round 四舍五入,float时返回int值,double时返回long值 
               */  
      System.out.println(Math.round(-10.5)); //-10
      System.out.println(Math.round(-10.51)); //-11
      /** 
               * rint 四舍五入,返回double值 
               */ 
      System.out.println(Math.rint(11.5)); //12.0
      System.out.println(Math.rint(10.5)); //10.0,注意0.5的时候取偶数
       
posted @ 2022-03-03 12:54  cvhgfds  阅读(82)  评论(0)    收藏  举报