Various digital types converted into string type - Java

xiaoxiao2021-03-06  68

Various digital types are converted into string type:

String s = string.valueof (value); // where Value is any number of digital types.

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 = bo.bytevalue ();

Short t = 169;

Short to = new short;

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-109812.html

New Post(0)