Good morning friends,
This is a common question which comes to programmers' minds.
Difference between string and String, bool and Bool etc.
The answer is quite simple; string is an alias (another name) for String (here String is System.String)
similarly, bool is alias and Bool is CLR type.
Following are some more examples:
They can be used interchangeably, but there is only one circumstance where you need to uses aliases and not the CLR type. While explicitly specifying the datatype for enum.
e.g., public enum Color : int
here Int32 would be invalid to use.
Hope this is helpful.
This is a common question which comes to programmers' minds.
Difference between string and String, bool and Bool etc.
The answer is quite simple; string is an alias (another name) for String (here String is System.String)
similarly, bool is alias and Bool is CLR type.
Following are some more examples:
| short | System.Int16 |
| ushort | System.UInt16 |
| int | System.Int32 |
| uint | System.UInt32 |
| long | System.Int64 |
| ulong | System.UInt64 |
They can be used interchangeably, but there is only one circumstance where you need to uses aliases and not the CLR type. While explicitly specifying the datatype for enum.
e.g., public enum Color : int
here Int32 would be invalid to use.
Hope this is helpful.
1 comment:
thanku javed....
ur valuable info helped me a lot..
infact its jus a life saver.............
garvita
Post a Comment