Is there a difference between bool and Boolean?

Asked

Viewed 1,827 times

2

Is there any difference compared to the types bool and Boolean? It seems to me that both have the same characteristics. I would like to know if there are differences between these types.

Example of implementation of both types:

class Program
{
    static void Main(string[] args)
    {
        bool variavelBool = false;
        Boolean variavelBoolean = variavelBool;

        Console.WriteLine("variavelBool = {0}, variavelBoolean = {1}", variavelBool, variavelBoolean);
        Console.ReadKey();
    }
}

Exit:

variableBool = False, variableBoolean = False

1 answer

4

In C# bool is just a nickname for System.Boolean, as well as int is a nickname for System.Int32. The complete list of aliases can be found here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.