It is a configuration file that contains setting for entire computer. It also contains the settings for machine wide assembly binding, built in remoring channels and ASP.net. It can be found in
.net framework install directory\framework\<version>\config
Example:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG |
Application domain is nothing but a boundary within which an application runs. A process can contain multiple application domains. Application domains provide an isolated environment to applications that is similar to the isolation provided by processes. An application running inside one application domain cannot directly access the code running inside another application domain. To access the code running in another application domain, an application needs to use a proxy. |
AppDomains are usually created by hosts (Windows Shell, ASP.NET and IE).
When you run a .NET application from the command-line, the host is the Shell. The Shell creates a new AppDomain for every application. AppDomains can also be explicitly created by .NET applications. |
An assembly which is created dynamically at run time, when an application requires the types within these assemblies is nothing but a dynamic assembly. |
Deep Copy is creating a new object and then copying the non static fields of the current object to the new object.
Example:
public object DeepCopy(object obj)
{
MemoryStream ms = new MemoryStream();
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(ms, obj);
object retval;
ms.Seek(0, SeekOrigin.Begin);
retval = bf.Deserialize(ms);
ms.Close();
return retval;
} |
The major difference between both the codes is that,
Imperative code does not return value whereas,
Interrogative code return value. |
TRIM() helps us to remove the off spaces characters from the beginning and from the end of the instance.
Example:
using System;
public class Example
{
public static void Main()
{
Console.Write("Enter your first name: ");
string firstName = Console.ReadLine();
Console.Write("Enter your middle name or initial: ");
string middleName = Console.ReadLine();
Console.Write("Enter your last name: ");
string lastName = Console.ReadLine();
Console.WriteLine();
Console.WriteLine("You entered '{0}', '{1}', and '{2}'.",
firstName, middleName, lastName);
string name = ((firstName.Trim() + " " + middleName.Trim()).Trim() + " " +
lastName.Trim()).Trim();
Console.WriteLine("The result is " + name + ".");
}
}
// The following is possible output from this example:
// Enter your first name: John
// Enter your middle name or initial:
// Enter your last name: Doe
//
// You entered ' John ', '', and ' Doe'.
// The result is John Doe |
|
Application Manifest is used to give the information to the operating system.
It is an XML file that describes and identifies the shared and private side-by-side assemblies that an application should bind to at run time. These should be the same assembly versions that were used to test the application.
They may also be used to describe the metadata for files that are private to the application. |
A strong name is an assembly which includes the following :
1) Name of the assembly
2) Version Number
3) Culture Identity
4) A public Key Token. |
Using Dynamic Link Library offers several advantages :
1) DLL's save memory
2) Reduces Swapping
3) Saves disk space
4) Upgrades easier. |
Some of the capitalization techniques are explained as below.
Pascal Casing: This convention capitalizes the first character of each word.
Example: MyWord.
Camel Casing: This convention capitalizes the first character of each word except the first word.
Example: myWord.
Upper Casing: This convention is used to capitalize identifiers, which contains an abbrevation of one or two characters.Identifiers which are of three or more characters use pascal casing instead.
Example: PI |
The dll does not get loaded into RAM memory together with the main program, so space is saved in RAM.When a dll file is called, then it is loaded. |
yes, Private class level variables are inheritable, but they are not accessible.
Example:
public class BaseClass
{
private const int _aNumber = 5;
public int ReturnANumber() { return _aNumber; }
}
public class DClass : BaseClass
{
public void SomeMethod()
{
// This is indirectly accessing a private implemented in the class
// this derives from, but existing inside this class.
int numbery = this.ReturnANumber();
}
}
public class Whatever
{
public void AMethod(DClass someDClass)
{
int thisIsNumberFive = someDClass.ReturnANumber();
}
} |
Immutable objects are the objects whose state cannot be changed or modified once it is created.
Ex: String objects are immutable. |
A prototype design pattern relies on creation of clones rather than objects.
Here, we avoid using the keyword 'new' to prevent overheads. |