You're on the right path, but first, lets clarify some of the terms you're using.
Quote:
To declare an object (variable), instantiate an object and assign the object to the object variable within a single statement:
ClassName ObjectName = new ClassName ();
|
Emphasis mine. This may have been a typo on your part, but just to make sure you understand the meaning of the terms, you cannot instantiate an object. An object is, by definition, an instance of a class. Thus, you instantiate a class (in the .NET world, we use the term 'type' rather than 'class'), which results in the creation of an object.
Quote:
|
But structures can be instantiated without use of the keyword "new" (unlike classes), which means that no constructor is executed when structures are instantiated in this way.
|
That is true, but structs can also be instantiated using a non-default constructor -- in other words, a constructor that
does require parameters.
Quote:
|
Plus, like all value types, structures lack inheritance functionality.
|
Yes and no. From the developer's perspective, you cannot create a structure that derives from some other struct. However, a struct
can implement interfaces. Also, structs themselves derive from System.ValueType.
Quote:
|
So are structures objects or not?
|
Yes. Everything in .NET derives from System.Object, including System.ValueType.
Quote:
They also can be instantiated without use of the keyword "new", but only if they are also initialized (and sized) within the same statement.
...
In this case, it must be that, as with structures, no constructor is executed.
|
Technically, the compiler is creating an instance of the array under the hood. It's an example of what is called "syntactic sugar" -- basically a shortcut afforded to the programmer by the compiler. In actuality, a constructor is being called, only the compiler is handling that for you.
Quote:
|
So are arrays really objects? They seem so different from other objects.
|
Yes. All arrays are derived from the abstract System.Array class. Arrays will always be allocated on the managed heap.
Quote:
|
Arrays are inherited from the System.Array class. But ALL data types in C#, even value types including implicit types, are implicitly inherited from the System.Object class. (Of course, that doesn't mean all variables, regardless of data type, are objects.)
|
The word 'object' does not necessarily mean 'reference type' in C#. Anything that derives from System.Object is an 'object', which is everything. Instead, the distinction is between 'reference type objects' and 'value type objects'. As you correctly pointed out before, reference type objects are created on the managed heap, while value type objects are created on the stack.
Quote:
|
So is the System.Array class inherited directly from the System.Object class?
|
Yes.
Quote:
|
(For that matter, is there any way I can actually read the namespace files?)
|
Yes, just check out MSDN or use Reflector to reflect over the .NET dll's.