Sdílet prostřednictvím


Short Constructors

Definition

Overloads

Short(Int16)

Constructs a newly allocated Short object that represents the specified short value.

Short(String)

Constructs a newly allocated Short object that represents the short value indicated by the String parameter.

Short(Int16)

Constructs a newly allocated Short object that represents the specified short value.

[Android.Runtime.Register(".ctor", "(S)V", "")]
public Short (short value);
[<Android.Runtime.Register(".ctor", "(S)V", "")>]
new Java.Lang.Short : int16 -> Java.Lang.Short

Parameters

value
Int16

the value to be represented by the Short.

Attributes

Remarks

Constructs a newly allocated Short object that represents the specified short value.

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

Java documentation for java.lang.Short.Short(short).

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

Short(String)

Constructs a newly allocated Short object that represents the short value indicated by the String parameter.

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

Parameters

s
String

the String to be converted to a Short

Attributes

Exceptions

if string cannot be parsed as a short value.

Remarks

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

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

Java documentation for java.lang.Short.Short(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