Digital type conversion under Java

zhaozj2021-02-16  57

OF: cat household converted into various types of digital string: String s = String.valueOf (value); // wherein the value is any one of a digital type. 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); transition between digital types and digital objects: BYTE B = 169; Byte Bo = New Byte (B ); b = bo.bytevalue (); short t = 169; short to = new short (t); t = to.shortvalue (); int i = 169; integer = new integer (i); i = IO. INTVALUE (); long L = 169; long lo = new long (l); l = l = 169f; float f = new float (f = fo.floatvalue (); Double D = 169f; double dobj = new double (d); d = dobj.doubleValue (); actual application may also be used in various digital types and byte numbers, and Java does not provide such support. Here I wrote a conversion tool. For your reference: Numbertool.java, please note that when the digital type is converted to byte arrays, the order in which the storage should be low before, and the high is behind. - From http://www.javaidea.net

Organize release: admin

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

New Post(0)