Byte.MaxValue Field in C#


The Byte.MaxValue field in C# is used to represent the largest possible value of a Byte.

Syntax

Following is the syntax −

public const byte MaxValue = 255;

Example

Let us now see an example to implement the Byte.MaxValue field −

using System;
public class Demo {
   public static void Main(){
      byte val;
      val = Byte.MaxValue;
      Console.WriteLine("Maximum Value (Byte) = "+val);
   }
}

Output

This will produce the following output −

Maximum Value (Byte) = 255

Updated on: 08-Nov-2019

154 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements