这些类都是在包java.lang中
1.构造方法
Byte(byte n)
Short(short n)
Integer(int n)
Long(int n)
Float(int n)
Double(double n)
2.类方法:通过调用以下类方法 可以将“数字格式”的字符串s转换成相应的基本数据类型的数据
parseByte(String s)
parseShort(String s)
parseInt(String s)
parseLong(String s)
parseFloat(String s)
parseDouble(String s)
3.实例方法:调用以下方法,可以返回相应数据类型的数据
byte byteValue()
short shortValue()
int intValue()
long longValue()
float floatValue()
double doubleValue()
本文介绍了Java.lang包中关于基本数据类型的构造方法、类方法及实例方法,包括如何使用这些方法进行不同数据类型间的转换。

445

被折叠的 条评论
为什么被折叠?



