are there any diferences between string and String/bool and Boolean? Shoud I prefer using one over other one? Or should I just try to avoid converting between these types (I already noticed that application is able to deal with this convert, but there could be some problem)...or is it just pointless question?
-
See this and thisLion– Lion2013-06-17 19:40:56 +00:00Commented Jun 17, 2013 at 19:40
-
What's the difference between a duck?Matthew– Matthew2013-06-17 19:41:12 +00:00Commented Jun 17, 2013 at 19:41
-
I think, that people, who answer these questions on SO, must receive -1000 votes automatically.Dennis– Dennis2013-06-17 19:42:44 +00:00Commented Jun 17, 2013 at 19:42
-
1@Dennis not really. Its acceptable to be not rude to someone new to SO, and an answer is welcome. But I sincerely hope OP removes this question. We already have a lot of this.nawfal– nawfal2013-06-17 19:48:55 +00:00Commented Jun 17, 2013 at 19:48
Add a comment
|
5 Answers
bool is an alias for System.Boolean just as int is an alias for System.Int32. See a full list of aliases Here. and Example
int x = 123;
System.Int32 x = 123;
Comments
If you look at the documentation, for example for bool, you'll see that they are just aliases, so any conversions are unnecessary.
I've rarely seen System.String and System.Boolean used explicitly, the aliases are used much more often (in some projects in 100% of cases, even for calling static methods like string.Join(...))