共用方式為


Byte Constructors

Definition

Overloads

Byte(SByte)

Constructs a newly allocated Byte object that represents the specified byte value.

Byte(String)

Constructs a newly allocated Byte object that represents the byte value indicated by the String parameter.

Byte(SByte)

Constructs a newly allocated Byte object that represents the specified byte value.

[Android.Runtime.Register(".ctor", "(B)V", "")]
public Byte (sbyte value);
[<Android.Runtime.Register(".ctor", "(B)V", "")>]
new Java.Lang.Byte : sbyte -> Java.Lang.Byte

Parameters

value
SByte

the value to be represented by the Byte.

Attributes

Remarks

Constructs a newly allocated Byte object that represents the specified byte value.

This member is deprecated. It is rarely appropriate to use this constructor. The static factory #valueOf(byte) is generally a better choice, as it is likely to yield significantly better space and time performance.

Java documentation for java.lang.Byte.Byte(byte).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Byte(String)

Constructs a newly allocated Byte object that represents the byte value indicated by the String parameter.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")]
public Byte (string s);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")>]
new Java.Lang.Byte : string -> Java.Lang.Byte

Parameters

s
String

the String to be converted to a Byte

Attributes

Exceptions

if string cannot be parsed as a byte value.

Remarks

Constructs a newly allocated Byte object that represents the byte value indicated by the String parameter. The string is converted to a byte value in exactly the manner used by the parseByte method for radix 10.

This member is deprecated. It is rarely appropriate to use this constructor. Use #parseByte(String) to convert a string to a byte primitive, or use #valueOf(String) to convert a string to a Byte object.

Java documentation for java.lang.Byte.Byte(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to