Possible Duplicate:
c#: difference between “System.Object” and “object”
Although I am currently working with C#, this question could possibly apply to other languages.
Is there any difference between invoking Object vs. object? Specifically, I was creating an instance of Dictionary with the constructor:
Dictionary<String, Object> foo = new Dictionary...
The IDE automatically filled in new Dictionary<string, object>. I went back and changed my initial declaration but it got me wondering.
String or Object versus lowercase string or object?object is a keyword (alias) for System.Object, the same applies to string.
When compiled it will be exactly the same thing.
On the MSDN page for object it says the following:
The object type is an alias for System.Object in the .NET Framework. You can assign values of any type to variables of type object.
You can find a long list of all the keywords in C# on MSDN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With