byte binary operation

In this chapter you will learn:

  1. Byte value binary and operation

Byte value binary and operation

using System;//from  ja v  a2 s  . c  o m

public class Example
{
   public static void Main()
   {

      byte mask = 0xFE;

      Byte byteValue = 12;
      Console.WriteLine("{0} And {1} = {2}", 
                    byteValue, mask,  byteValue & mask);

   }
}

Next chapter...

What you will learn in the next chapter:

  1. How to check byte overflow with unchecked
  2. Catching an underflow exception
Home » C# Tutorial » Byte, Integer, Long
Integer Family
Integer ranges
byte
Convert to byte
Parse string to byte
byte format
byte octal and hexadecimal
byte binary operation
byte overflow with unchecked
int
int value
Compare int value
int calculation
int value overflow
int binary operation
Parse string to int value
Format int value
int in binary, octal and hexadecimal
long
long value calculation
ulong