Q1: If you are just learning about C# then metadata isn't something you really really need to worry about at all - your compiler will 100% take care of managing all of this. However - all metadata refers to in .net is just a cache that the CLR uses to reference classes and their methods, parameters, and attributes. It describes both the classes that are inside your program and all of the classes that your classes reference. Yes, this includes information about their members.
Q2 : I'm not sure what you mean by "interact" but all this handles is mapping out all the files of an assembly, and handles resolution of types and resources for that assembly - I don't believe it has much to do with handling multiple assemblies -
Again, this is something you could live the rest of your life not knowing about.
Q3 : ok, so do some more research on exactly what a Class is and an instance of a class. Also look up what "Scope" is and how it relates to class (instance) variables.
Take the following class for example:
public class MyClass
private string myVariable;
public void SetInternalVariable(string value)
myVariable = value;
public string PrintTwoStrings(string myVariable)
Now let's put this into a quick program...
MyClass myInstance1 = new MyClass();
MyClass myInstance2 = new MyClass();
myInstance1.SetInternalVariable("I'm inside instance 1");
myInstance2.SetInternalVariable("I'm inside instance 2");
myInstance1.PrintTwoStrings("Printing instance 1:");
myInstance2.PrintTwoStrings("Printing instance 2:");
Now - both myInstance1 and myInstance2 return different results when calling the PrintTwoStrings method. Think an instance (or object) as a copy of a class in memory. Then think of each class as having a built in special variable called 'this'. The 'this' variable references the instance - or copy - that is currently executing your code.
In some cases you actually have two variables with the same exact name and are only seperated by having different 'scopes'. For example in the method PrintTwoStrings - you have the string variable that was passed to the method named "myVariable" (this is a local scope) - and the private variable declared in your class also named "myVariable" (this is called an instance variable - it has a global scope in your class). If you need to work with the local variable named "myVariable" you simply just type out the name of the variable and C# assumes you mean the most-local variable of that name. Otherwise if you want to reference the variable that is actually attached to the calling instance of your class, you have to use the 'this' keyword. So:
Sorry - it's really hard to understand this concept until you understand classes and instances better.
Q4 : You are correct - I used poor terminology when describing that. No, you do not overwrite the red car - you merely tell 'car' to point to a different Car object. In a non-managed language you would actually be overwriting the memory that held the previous object.
Managed memory has a ton of code behind the code you are actually writing. For example, when you create a new object in memory - your framework is actually handling all references to that object and keeping track of everything that is referencing that object at all times. During a periodic GC, if your framework sees that no one is referencing an object anymore - it marks that memory back to unreserved. The next time an object needs to be created - that memory can then be used to store its information.
My suggestion is to really focus on Object Oriented Theory and Design. It seems you have a plenty solid understanding of the concept of "Programming" but are struggling with what "Object Oriented" programming is.
Once you get a good grasp on OOP - things in C# will start to make a lot more sense - Also pick up a book on "Design Patterns" - this will help you understand object oriented programming more than anything.
Think of C# as more of a tool to create Object Oriented Code (instead of a tool to create programs):
If you think of it this way then no matter how much you know about C# - if you don't understand what you are trying to make with it then you'll never get anywhere.