Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly. |
Yes, but they are not accessible. Although they are not visible or accessible via the class interface, they are inherited. |
The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identacle object. |
By calling Array.Sort() and then Array.Reverse() methods. |
|
Yes. The keyword “sealed” will prevent the class from being inherited. |
Yes. Just leave the class public and make the method sealed. |
|
Different parameter data types, different number of parameters, different order of parameters. |
We can use pass it with ExecuteReader method of Command object like
reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
This will make sure that when we are calling reader.Close() the associated connection object will also be closed. |
int m_PersonID = 0;
public int PersonID
{
get { return m_PersonID; }
set { m_PersonID = value; }
} |
DateTime DateOfBirth { get;set;}
int Age { get;set;}
string FirstName { get;set;}
As this is an Interface, so no implementation required only definition of properties are required. Implementation of these properties will be written into the class inherting this interface. |
void Calculate();
int Insert(string firstName, string lastName, int age);
Interface doesn't contain implementation so methods implementation will be written into class inherting this interface. |
Lets say you have to load the assembly from GAC on button click event then you should write following method.
protected void btn_Click(object sender, EventArgs e)
{
AssemblyName asm = new AssemblyName("ClassLibrary1, Version=1.1.0.0, Culture=neutral,
PublicKeyToken=fbc28d9ca2fc8db5");
Assembly al = Assembly.Load(asm);
Type t = al.GetType("ClassLibrary1.Class1");
MethodInfo m = t.GetMethod("Method1");
str = "reflection - " + (string)m.Invoke(null, null);
MessageBox.Show(str);
}
For more visit http://www.infosysblogs.com/microsoft/2007/04/loading_multiple_versions_of_s.html |
Dispose is a method for realse from the memory for an object.
For eg:
<object>.Dispose.
Finalize is used to fire when the object is going to realize the memory.We can set a alert message to says that this object is going to dispose. |
The data value may not be changed. Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory. |