美文网首页
基本类型包装,及运算

基本类型包装,及运算

作者: 893705279802 | 来源:发表于2018-12-12 16:55 被阅读0次
    基本类型包装类

    Integer类parseInt方法

    parseInt("    ")转10进制


    Integer类构造方法

    intvalue(String  s)引用型转int型


    Integer类其他方法


    获取int的最大值和最小值


    自动装箱和自动拆箱,JDK1.5新特性(了解)


    自动装箱和自动拆箱练习题

    问题


    System类方法exit

    退出虚拟机


    System类方法gc


    System类方法getProperties


    System类方法arraycopy

    arraycopy复制数组


    Math类的方法_1


    static double sqrt(double d)

    返回参数的平方根

    static double pow (double a, double b)

    a的b次方

    2的3次方


    static double floor(double d)

    返回  <  或  =  参数d的 最大整数


    static double ceil(double d)

    返回  >  或  =  d的最小整数


    static int abs(int i)

    获取参数的绝对值


    Math类的方法_2


    static double round(doubl d)

    获取参数的四舍五入,取整数


    static double random() 返回随机数 0.0-1.0之间

    来源,也是Random类   nextDouble();


    Arrays工具类


    static String toString(数组)

    *  将数组变成字符串

    [1,2,3,4]


    static int binarySearch(数组, 被查找的元素)

    *  数组的二分搜索法

    *  返回元素在数组中出现的索引

    *  元素不存在, 返回的是  (-插入点-1)

    返回索引


    static void sort(数组)

    *  对数组升序排列


    BigInteger类四则运算


    BigInteger b1 = new BigInteger("5581613661405146");


    BigDecimal类概述

    问题


    BigDecimal实现三则运算


    计算b1+b2的和,调用方法add


    计算b3-b2的差,调用方法subtract


    计算b5*b6的成绩,调用方法 multiply


    BigDecimal类实现除法

    相关文章

      网友评论

          本文标题:基本类型包装,及运算

          本文链接:https://www.haomeiwen.com/subject/utcyhqtx.html