Boolean represents just two values, i.e. True or False.
A bool Data Type can accept only true or false.
public class MyApplication { public static void Main(string[] args) { bool x = true; bool y = false; System.Console.WriteLine(x); System.Console.WriteLine(y); } }
So, in the above code, we have created a variable named x of Boolean data type and initialised it with value True.
bool x = true;
And created one more variable called y of Boolean data type and initialised it with value False.
bool y = false;
But if we want to initialise a Boolean type variable with anything other than true/false, it would end up with an error.