Declare 3 bools on a single line : boolean Data Type « Data Type « C# / CSharp Tutorial






class Program
  {
    static void Main(string[] args)
    {
      int myInt = 0;
      string myString;
      myString = "This is my character data";

      // Declare 3 bools on a single line.
      bool b1 = true, b2 = false, b3 = b1;

      System.Boolean b4 = false;

      System.Console.WriteLine("Your data: {0}, {1}, {2}, {3}, {4}, {5}",myInt, myString, b1, b2, b3, b4);
    }

  }








2.2.boolean Data Type
2.2.1.The bool Type
2.2.2.Output a boolean variable with Console.WriteLine
2.2.3.bool values in if statement
2.2.4.if statement with bool variable
2.2.5.Declare 3 bools on a single line
2.2.6.Using ToString() to Convert to a string
2.2.7.Generic and nongeneric versions of the CompareTo method for Boolean type