zoukankan      html  css  js  c++  java
  • 4.03_常见类

    一、Math类概述
      * Math 类包含用于执行基本数学运算的方法,如初等指数、对数、平方根和三角函数。
      * B:成员方法
        * public static int abs(int a)
        * public static double ceil(double a)
        * public static double floor(double a)
        * public static int max(int a,int b) min自学
        * public static double pow(double a,double b)
        * public static double random()
        * public static int round(float a) 参数为double的自学
        * public static double sqrt(double a)

    二、Random类的概述和方法使用
      * A:Random类的概述
        * 此类用于产生随机数如果用相同的种子创建两个 Random 实例,
        * 则对每个实例进行相同的方法调用序列,它们将生成并返回相同的数字序列。
      * B:构造方法
        * public Random()
        * public Random(long seed)
      * C:成员方法
        * public int nextInt()
        * public int nextInt(int n)(重点掌握)

    三、System类的概述和方法使用
      * A:System类的概述
        * System 类包含一些有用的类字段和方法。它不能被实例化。
      * B:成员方法
        * public static void gc()
        * public static void exit(int status)
        * public static long currentTimeMillis()
        * pubiic static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length)

    四、BigInteger类的概述和方法使用)
      * A:BigInteger的概述
        * 可以让超过Integer范围内的数据进行运算
      * B:构造方法
        * public BigInteger(String val)
      * C:成员方法
        * public BigInteger add(BigInteger val)
        * public BigInteger subtract(BigInteger val)
        * public BigInteger multiply(BigInteger val)
        * public BigInteger divide(BigInteger val)
        * public BigInteger[] divideAndRemainder(BigInteger val)

    五、BigDecimal类的概述和方法使用
      * A:BigDecimal的概述
        * 由于在运算的时候,float类型和double很容易丢失精度,演示案例。
        * 所以,为了能精确的表示、计算浮点数,Java提供了BigDecimal

        * 不可变的、任意精度的有符号十进制数。
      * B:构造方法
        * public BigDecimal(String val)
      * C:成员方法
        * public BigDecimal add(BigDecimal augend)
        * public BigDecimal subtract(BigDecimal subtrahend)
        * public BigDecimal multiply(BigDecimal multiplicand)
        * public BigDecimal divide(BigDecimal divisor)
      * D:案例演示
        * BigDecimal类的构造方法和成员方法使用

    六、Date类的概述和方法使用
      * A:Date类的概述
        * 类 Date 表示特定的瞬间,精确到毫秒。
      * B:构造方法
        * public Date()
        * public Date(long date)
      * C:成员方法
        * public long getTime()
        * public void setTime(long time)

    七、SimpleDateFormat类实现日期和字符串的相互转换
      * A:DateFormat类的概述
        * DateFormat 是日期/时间格式化子类的抽象类,它以与语言无关的方式格式化并解析日期或时间。是抽象类,所以使用其子类SimpleDateFormat
      * B:SimpleDateFormat构造方法
        * public SimpleDateFormat()
        * public SimpleDateFormat(String pattern)
      * C:成员方法
        * public final String format(Date date)
        * public Date parse(String source)

    八、Calendar类的概述和获取日期的方法
      * A:Calendar类的概述
        * Calendar 类是一个抽象类,它为特定瞬间与一组诸如 YEAR、MONTH、DAY_OF_MONTH、HOUR 等日历字段之间的转换提供了一些方法,并为操作日历字段(例如获得下星期的日期)提供了一些方法。
      * B:成员方法
        * public static Calendar getInstance()
        * public int get(int field)


    九、Calendar类的add()和set()方法)
      * A:成员方法
        * public void add(int field,int amount)
        * public final void set(int year,int month,int date)

  • 相关阅读:
    数据库设计:数据库设计步骤,er图,三大范式
    连接查询
    连接查询和分组查询
    Django项目的创建与配置
    WEB框架的原理总结
    RabbitMQ---消息队列
    Djang之基于角色的权限控制(RBAC)
    Django之基于RBAC权限控制生成动态菜单
    关于装饰器的一些小练习
    关于简单的python函数的一些小练习题
  • 原文地址:https://www.cnblogs.com/zyyzy/p/12432442.html
Copyright © 2011-2022 走看看