您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 其它行业文档 > java_java lang包
14java.langjava.lang.,java.lang.Java.Java.java.lang:BooleanByteCharacterClassClassLoaderCompilerDoubleFloatInheritableThreadLocal(Java2)IntegerLongMathNumberObjectPackage(Java2)ProcessRuntimeRuntimePermission(Java2)SecurityManagerShortStrictMath(Java2,1.3)StringStringBufferSystemThreadThreadGroupThreadLocal(Java2)ThrowableVoidCharacter:Character.SubsetCharacter.UnicodeBlock,Java2.java.lang:CloneableComparableRunnableComparableJava2.java.lang,Java1.0.Java2,,.Java2,.Java2.Java2java.lang,.14.11,,Java,(int)2622Java(char)...,(int)(sameinstance)..15;,.,Java.,(wrap).,(wrappers).14.1.1NumberNumber(byte),(short),(int),(long),(float)(double).Number.,doubleValue()(double),floatValue()(float).:bytebyteValue()doubledoubleValue()floatfloatValue()intintValue()longlongValue()shortshortValue().Number66:(Double),(Float),(Byte),(Short),(Integer)(Long).14.1.2DoubleFloat(Double)(Float)doublefloat.(Float):Float(doublenum)Float(floatnum)Float(Stringstr)NumberFormatException,(Float)floatdouble..(Double):Double(doublenum)Double(Stringstr)NumberFormatException(Double)(double).(Float)14-1.(Double)14-2.(Float)(Double):MAX_VALUEMIN_VALUE14java.lang(float)(double)(Class)14-1FloatbytebyteValue()intcompareTo(Floatf)()263NaNPOSITIVE_INFINITYNEGATIVE_INFINITYTYPEf,,0.f,.f,(Java2)objFloat,compareTo(Float).,ClassCastException(Java2)()floatFloatObj,true.falsenumIEEE()num,IEEE(float)(int),true.falsenum,true.false,true.falsenum,true.false()10,str(Java2)()numstrfloatintcompareTo(objectobj)doubledoubleValue()booleanequals(ObjectFloatObj)staticintfloatToIntBits(floatnum)FloatfloatValue()inthashCode()staticfloatintBitsToFloat(intnum)intintValue()booleanisInfinite()staticbooleanisInfinite(floatnum)booleanisNaN()staticbooleanisNaN(floatnum)longlongValue()staticfloatparseFloat(Stringstr)throwsNumberFormatExceptionshortshortValue()StringtoString()staticStringtoString(floatnum)staticFloatvalueOf(Stringstr)throwsNumberForamtException264214-2JavaDouble()d.,0.d,.d,(Java2)objDouble,compareTo(Double).,ClassCastException(Java2)numIEEE()doubleDoubleObj,true.,false()(),true.,falsenum,true.,false,true.,falsenum,true.,falsenum,IEEE(double)()10,str(double)(Java2)()numstrdoublebytebyteValue()intcompareTo(Doubled)IntcompareTo(Objectobj)staticlongdoubleToLongBits(doublenum)doubledoubleValue()booleanequals(ObjectDoubleObj)floatfloatValue()inthashcode()intintValue()booleanisInfinite()staticbooleanisInfinite(doublenum)booleanisNaN()staticbooleanisNaN(doublenum)staticdoublelongBitsToDouble(longnum)longlongValue()staticdoubleparseDouble(Stringstr)throwsNumberFormatExceptionshortshortValue()StringtoString()StaticStringtoString(doublenum)StaticDoublevalueOf(Stringstr)throwsNumberFormatExceptiondouble——(double),(double).14java.langclassDoubleDemo{publicstaticvoidmain(Stringargs[]){Doubled1=newDouble(3.14159);Doubled2=newDouble(314159E-5);System.out.println(d1+=+d2+-+d1.equals(d2));}}265,equals()true,(double).3.14159=3.14159–trueisInfinite()isNaN()(Float)(Double)isInfinite()isNaN(),(double)(float),IEEE:NaN().,isInfinite()true.,isNaN()true.Double;,://DemonstrateisInfinite()andisNaN()classInfNaN{publicstaticvoidmain(Stringargs[]){Doubled1=newDouble(1/0.);Doubled2=newDouble(0/0.);System.out.println(d1+:+d1.isInfinite()+,+d1.isNaN());System.out.println(d2+:+d2.isInfinite()+,+d2.isNaN());}}:Infinity:true,falseNaN:false,true14.1.3Byte,Short,IntegerLongByte,Short,Integer,Long(byte),(short),(int)(long).:Byte(bytenum)Byte(Stringstr)NumberFormatExceptionShort(shortnum)Short(Stringstr)NumberFormatExceptionInteger(intnum)2662JavaInteger(Stringstr)NumberFormatExceptionLong(longnum)Long(Stringstr)NumberFormatException,.14-314-6.,.,radix,.(binary)2,(octal)8,(decimal)10,(hexadecimal)16.14-3bytebyteValue()intcompareTo(Byteb)Byte()b.,0.b,.b,(Java2)objByte,compareTo(Byte).,ClassCastException(Java2)strByte()ByteByteObj,true.,false()()()10,str(byte)()numstrByte(radix),strByteintcompareTo(Objectobj)staticBytedecode(Stringstr)throwsNumberFormatExceptiondoubledoubleValue()booleanequals(ObjectByteObj)floatfloatValue()inthashCode()intintValue()longlongValue()staticbyteparseByte(Stringstr)throwsNumberFormatExceptionstaticbyteparseByte(Stringstr,intradix)(radix),strthrowsNumberFormatExceptionshortshortValue()StringtoString()staticStringtoString(bytenum)staticBytevalueOf(Stringstr)throwsNumberFormatExceptionstaticBytevalueOf(Stringstr,intradix)throwsNumberFormatException14java.lang14-4bytebyteValue()intcompareTo(Shorts)Short267()s.,0.s,s,(Java2)objShort,compareTo(Short).,ClassCastException(Java2)strShort()(Interger)ShortObj,true.,false()()()10,str(Short)(Short)()num10,strShortShort14-5Integer()i.,0.i,.i,(Java2)intcompareTo(Objectobj)staticShortdecode(Stringstr)throwsNumberFormatExceptiondoubledoubleValue()booleanequals(ObjectShortObj)floatfloatValue()inthashCode()intintValue()longlongValue()staticshortparseShort(Stringstr)throwsNumberFormatExceptionstaticshortparseShort(Stringstr,radix)(radix),strintthrowsNumberFormatExceptionshortshortValue()StringtoString()staticStringtoString(shortnum)staticSho
本文标题:java_java lang包
链接地址:https://www.777doc.com/doc-6182564 .html