Java常用类

 

基本数据类型

包装类

byte

Byte

short

Short

int

Integer

long

Long

float

Float

double

Double

char

Character

boolean

Boolean

parseInt(String str)

将String转成Integer

equals(Oject IntObj)

比较两个对象值是否相同

toString()

返回Integer值的String对象

intValue()

以int型返回Integer对象

byteValue()

以short型返回Integer对象

        Math数学类

            常用静态方法:

方法

返回值

功能描述

exp(double a)

double

获取e的a次方

sqrt(double a)

double

获取a的平方根

cbrt(double a)

double

获取a的立方根

ceil(double a)

double

获取>=a的整数

floor(double a)

double

获取<=a的整数

        Date类常用方法

方法

返回值

功能描述

aftrer(Date wh)

boolean

判断当前是否为指定日期后

before(Date wh)

boolean

判断当前是否为指定日期前

getTime()

long

返回时间戳

setTime(long t)

void

设置当前时间

posted @ 2021-11-09 09:16  ZikC  阅读(27)  评论(0编辑  收藏  举报