System.Object is a type surfaced by the CLR and the .Net Framework. The C#
language defines the type object, as an alias to System.Object. A similar
thing happens with System.String aka string, and some other types (which I
don't have an exhaustive list of, so I won't even make an attempt of listing
them).
If you use the name Object, that means that you must have done the statement
using System; in your program - the full type name is System.Object.
I'm fairly sure that the types are a direct alias, so using one should be
exactly the same as typing the other. But I should hedge my bets, and
suggest that maybe a super language-guru might be able to come up with an
instance where it matters?
--Don
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"muesliflakes" <mu**********@yahoo.com.au> wrote in message
news:8d**************************@posting.google.c om...
I come from Java and an Object would be the class whist object would
likly be the varible to an object.
I get the impression with C# that object is just an alias to the Base
Class Object.
Can anyone enlighten me as to any differences and by convention if I
had a method that returns an object should I use one over the other.
public object ReturnIt( ) { return new Blah( ); }
or
public Object ReturnIt( ) { return new Blah( ); }