Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SByte.MaxValue Field

Represents the largest possible value of SByte. This field is constant.

The SByte type is not CLS-compliant. The CLS-compliant alternative type is Int16. For more information about CLS compliance, see What is the Common Language Specification.

[C#]
public const sbyte MaxValue;
[C++]
public: const char MaxValue;
[JScript]
public var MaxValue : SByte;

[Visual Basic] Visual Basic does not support constant fields of type SByte.

Remarks [C#, C++, JScript]

The value of this constant is 127; that is, hexadecimal 0x7F.

Example

The following sample demonstrates the MaxValue property.

[Visual Basic] 
' Visual Basic does not support the constants, SByte.MaxValue and SByte.MinValue. 
' Use the CLS-compliant type, Int16, instead.
    Dim max, min as Int16
    max = 127
    min = -128
        Console.WriteLine("Max byte={0}", max)
        Console.WriteLine("Min byte={0}", min)

[C#] 
Console.WriteLine("Max signed byte={0}", SByte.MaxValue);
Console.WriteLine("Min signed byte={0}", SByte.MinValue);

[C++] 
Console::WriteLine("Max signed byte={0}", __box(SByte::MaxValue));
Console::WriteLine("Min signed byte={0}", __box(SByte::MinValue));

[JScript] 
Console.WriteLine("Max signed byte={0}", SByte.MaxValue);
Console.WriteLine("Min signed byte={0}", SByte.MinValue);

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

SByte Structure | SByte Members | System Namespace | MinValue

Show:
© 2015 Microsoft