Tell about static and instance class members?

  • When a class member includes a static modifier,the member is called as static member.When no static modifier is present the member is called non-static or instance member.
  • Static members are invoked using class name where as instance members are invoked using instances(objects) of the class.
  • An instance member belongs to specific instance(object) of a class.If we create three objects of a class we have three sets of instance members in the memory, where as there will ever be only one copy of the static member,no matter how many instances of a class are created.

What is GAC? Where is it located?

Global assembly cache  (GAC) is a folder in windows directory to store the .NET assemblies that are specifically designated to be shared by all applications executed on a system. Assemblies can be shared among multiple applications on the machine by registering them in global assembly cache(GAC).

To install assembly in Cache, use  Gacutil. To run Gacutil, goto “Visual Studio Command Prompt” and type “gacutil -i <assembly_name>”, where (assembly_name) is the DLL name of the project.

 To uninstall assembly, type gacutil –u <assembly name> in  Visual Studio Command Prompt.

What is Assembly?

An Assembly is a “unit of deployment” for .NET ,almost always a .exe or .dll. A .NET assembly is a file that contains our compiled code, code that can execute under supervision of Common Language Runtime.

In C# terms its basically a single C# project.

Assemblies are building blocks of  .NET Framework applications; they form the fundamental unit of deployment ,version control, reuse ,activation, scoping and security permissions.

An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime with the information it needs to be aware of the type implementations. To the runtime, a type does not exist outside the context of an assembly.

What is a Object?

An object is an entity that has Properties for identifying State, Methods for behavior, Events for depicting the change of State.

Data associated at any given instance of time is the state of an object.

Every object differs from other objects either by state or behavior.

Using Column Names “FROM” and “TO” in a table and trying to lnsert data into table

When in a database if you have a table with column names “FROM” and “TO” you should be careful while trying to reference these column names in your sql command.

You should enclose these column names in square  brackets so that SQL will identify them as column names and our command works as we expected without any errors.

You should enclose as shown here:

Select CompanyName,[From],[To],Skillset from WorkExperience 

What is CLR

Common Language Runtime or CLR is the run-time execution environment of .Net Framework. Converting MS-IL into platform or OS specific code is done by the CLR.
CLR is responsible for bringing application to life and its also the CLR’s job to tear down application when its finished executing or if it has an unrecoverable error.

CLR actively tracks all the memory a program uses and it knows when the program is finished with memory so it will clean things up and allows program to have enough memory as it runs. The CLR also virtualizes our execution environment so we don’t have to worry about things like CPU cores,32bit or 64 bit or what instruction set is available. The CLR will take care of all those things and makes sure that our application will execute correctly.

What is Garbage Collector?

Garbage collector serves as a automatic memory manager. It has the following benefits:

  • It would enable us to develop our application without having to free memory.
  •  It allocates objects on managed heap efficiently.
  •  It reclaims the objects that are no longer being used, clears their memory and keeps the memory available for future allocations.
  •  It provides memory safety by making sure that an object cannot use the context of another object.

    What is .NET Framework?

    .NET Framework is a software framework developed by Microsoft that can be used to develop business applications, to build games, web applications and apps that can run on different types of phones and mobile devices.