Monday, June 27, 2016

What is .Net Frame Work 2016

Q.What is .Net Frame Work?

Ans:
The .NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services. The .NET Framework is designed to fulfill the following objectives:

  • To provide a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely.
  • To provide a code-execution environment that minimizes software deployment and versioning conflicts.
  • To provide a code-execution environment that promotes safe execution of code, including code created by an unknown or semi-trusted third party.
  • To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments.
  • To make the developer experience consistent across widely varying types of applications, such as Windows-based applications and Web-based applications.
  • To build all communication on industry standards to ensure that code based on the .NET Framework can integrate with any other code.
  • The .NET Framework has two main components: the common language runtime and the .NET Framework class library. 

How many types of Compilers in dotnet 2016

How many types of Compilers CLR using for Converting Native code?
Three Types
Just-in-Time (JIT)
Pre –JIT
Econo-JIT
Normal-JIT
Pre-JIT:
Pre-JIT complies complete source code into native code in a single compilation cycle.Its hapeen at the time of deployment.

Econo-JIT:-
Econo-JIT compiles only those methods which are called at runtime and these methods are removed when these are not required.

Normal-JIT:-
 Compiles method that is called on runtime. These methods are called first time they are compiled and then stored in cache.

Garbage collector 2016

Q.Garbage collector Generations?

Ans:
Generation 0 - When an object is initialized, it’s in generation 0. These are new objects that have never been played around with by the GC. As and when more objects get created, the process of Garbage Collection is invoked by the CLR.
Generation 1 - The objects that survive the garbage collection process are considered to be in generation 1. These are the old objects.
Generation 2 - As more new objects get created and added to the memory, the new objects are added to generation 0, the generation 1 old objects become older, and so are considered to be in generation 2. Generation 2 is the highest level generation in the garbage collection process. Any further garbage collection process occurring causes the level 1 objects promoted to level 2, and the level 2 objects stay in level 2 itself, as this generation level is the highest level.

So what is the importance & use of the generation’s process? It’s actually the priority the GC gives to objects while freeing objects from the heap. During every GC cycle, the objects in the Generation 0 are scanned first -> Followed by Generation 1 and then 2. This is because the generation 0 objects are usually short term objects that need to be freed. The newer an object, the shorter its life is. The older an object, longer its life is.

This process also helps in categorizing the memory heap as to where the de-allocation needs to be done first and where next.