0

Possible Duplicate:
String vs string in C#

I know there is no difference between using string and String. But, why is there the option in C#? Is it the same for object and Object?

EDIT

Note, that I am asking why.

Community
  • 1
  • 1
Chris
  • 2,959
  • 1
  • 30
  • 46
  • dupe: http://stackoverflow.com/questions/215255/string-vs-string-in-c – Steven Evers Jun 23 '10 at 20:37
  • I've seen this question, but the answers didn't answer my question, which is the "why", not the "what" and "how". Is this really a dupe, or just a vote-to-close-dogpile-without-reading-the-question? If the answer can be found on the other page, please point me to it. Femaref and Daryl give answers below for my question. – Chris Jun 23 '10 at 20:58

2 Answers2

5

In the MS implementation of the C# standards, string maps to System.String and object maps to System.Object. In other implementations, this could map to other classes. So if you use string and object, you are on the safer side if you should ever compile it with another compiler.

Femaref
  • 60,705
  • 7
  • 138
  • 176
1

string is just an alias for System.String. It is just a shorthand the same way that int is shorthand for System.Int32.

Dan Fox
  • 1,643
  • 15
  • 10
Daryl
  • 66
  • 2