Java type conversion

xiaoxiao2021-03-06  53

String type conversion into various digital types:

String s = "169"; byte b = byte.parsebyte (s); short t = short.parseshort (s); int i = integer.parseint (s); long l = long.parselong (s); float f = FLOAT.PARSEFLOAT (S); double d = double.parsedouble (s);

Conversion between digital types and digital classes:

BYTE B = 169; BYTE BO = New Byte (b); b); b); b = bo.bytevalue ();

Short T = 169; Short to = New Short (T); t = to.shortvalue ();

INT I = 169; Integer IO = New Integer (i); i = o.intvalue ();

Long L = 169; long lo = new long (l); l = lo.longvalue ();

Float f = 169f; float fo = new float (f); f = fo.floatvalue ();

Double d = 169f; double dobj = new double (d); d = dobj.doublevalue ();

转载请注明原文地址:https://www.9cbs.com/read-114364.html

New Post(0)