April 22, 2016

Code execution Process in C | Java | Dotnet

In this lession we learn how to execute code in different programming languages like c,java,and dotnet.

In Normal Programming languages like C|C++|Cobol|etc.

  • In these programming languages, language compile will convert the source code and generates the native code.
  • code execution in c
    code execution in c
  • In general at the time of compilation language compiler will consider two factors.
    1. CPU/ Processor Architecture.
    2. Operating system Architucture
  • Native code will be generated in such a way that it should be understood by the current processor and the operating system in which the code is being compiled and run.

What is Platform ?

Platform is the combination of CPU Architecture and Operating System Architecture.

What is platform Dependency?

  • Code that has been generated by the language compiler compilation does't run/ execute on a different processor and in different Operating System than which it has been compiled , this nature is known as platform dependency.

Platform In dependency

  • If the code generated by language compiler(LC) compilation runs on any processor and in any operating System than which it has been compiled then it is known as platform independent.

Code Execution in Java

  • In Java source code is compiled by java language compiler(JLC) and an intermediately code is generated known as byte code.
  • This byte code is platform independent, which can be executed on any machine and in any operating system where JVM( Java Virtual Machine) is available.
  • JVM Converts the byte code in to native code
  • code execution in java
    code execution in java
  • JVM is not a hard ware component rather it is a software component tool.
  • Sun Company designed separate JVM for each Operating System, so that Byte Code is able to run in any Operating System.
  • If there is no JVM compatible for any Operating System Byte Code can not be run in that operating System.

Code Execution in .Net

  • in .Net code is compiled twice.
  • in first compilation source code is compiled by respective language compiler and an intermediately code is generated known as MSIL.
  • In second Compilation MSIL is Converted in to Native Code using CLR
  • code execution in dotnet
    code execution in dotnet

    Note: LC: Language Compiler MSIL:Microsoft intermediate Language CIL: Common Intermediate Language CLR: Common Language Runtime

  • In Dot net we have two compilations.
  • Always First compilation is slow and second compilation is fast.
  • First Compilation : Means Language Compiler compiles the source code and provide the MSIL(Microsoft Intermediate Language) code.
  • Second Compilation : CLR Converts the MSIL code to Native code means executable code then code will be executed by CLR.
  • Here .NET source code means code that has been written in any programming language supported by .NET
  • Every programming language has its own compiler.
Check How much understand Our notes Interview Question on Dot Net

Write comments
  1. Programming is very interesting and creative thing if you do it with love. Your blog code helps a lot to beginners to learn programming from basic to advance level. I really love this blog because I learn a lot from here and this process is still continuing.
    Love from Pro Programmer

  2. If anyone want to become an Dotnet certified professional reach TIS Academy, which offers best
    Dot Net Training in Chennai with years of experienced professionals. For more details about courses…
    Selenium Training in Chennai