标签云

微信群

扫码加入我们

WeChat QR Code

Possible Duplicate:
What is the difference between String and string

When I run:

char c1 = 'a';
Console.WriteLine(c1);

and when I run:

Char c2 = 'a';
Console.WriteLine(c2);

I get exactly the same result, a.

I wanted to know what is the difference between the two forms, and why are there two forms?


Such questions can be self-answered. From your point above just go ahead with 'if(c1.GetType() == c2.GetType()){ MessageBox.Show("Same"!); }. Compare the getType()-output of both variables. The system will tell you the answer. ^^

2018年08月22日18分22秒

Why the downvote? If you don't explain what it is that you think is wrong, it can't improve the answer.

2018年08月22日18分22秒

These are just aliases in C# ** object: System.Object ** string: System.String ** bool: System.Boolean ** byte: System.Byte ** sbyte: System.SByte ** short: System.Int16 ** ushort: System.UInt16 ** int: System.Int32 ** uint: System.UInt32 ** long: System.Int64 ** ulong: System.UInt64 ** float: System.Single ** double: System.Double ** decimal: System.Decimal ** char: System.Char **

2018年08月22日18分22秒