How to execute code in different programming languages like c,java,and dot net.
What is Platform ?
Platform is that the combination of mainframe(CPU) design and software system design.
What is platform Dependency?
Code that has generated by language compiler compilation and does not execute on a any different processor and in different Operating System than which it has been compiled , this nature is known as platform 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.
Normal Programming languages like C|C++|Cobol|etc.
- In these programming languages, language compile will convert the source code and generates the native code.
General at the time of compilation language compiler can contemplate 2 factors.
- CPU/ Processor Architecture.
- Operating system Architecture
Native code 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.
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
- 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.
- First st compilation original code is compiled by individual language compiler and an intermediately code is generated called MSIL.
- Second Compilation MSIL is Converted in to Native Code using CLR
Note: LC: Language Compiler MSIL:Microsoft intermediate Language CIL: Common Intermediate Language CLR: Common Language Runtime
- Dot net having two compilations.
- 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.
Conclusion: Laks tutorial always try to provide information in simple and easy way to understand the our readers. If you like the content subscribe us you get the our latest posts directly to the Inbox and also Encourage with your like of our facebook page.