12/4/2023 0 Comments Jvm vs java compilerThis generated file is also referred to as a. The compilation process in Java instead generates a special format called byte code. Step-by-Step Execution of Java ProgramsĬontrary to other compilers, the Java compiler doesn't produce native executable files or code for a particular platform. ![]() Thus, C/C++ is platform dependent programming language. This file cannot run on Mac, Unix, or other Operating Systems as the machine code is different for different Operating Systems. This natively generated code runs only on Windows Operating System. The compilation process will generate natively executable code as a. The code is first converted into machine-readable language when the C/C++ program is written and compiled in Windows OS. Machine Language Code is unique for different platforms. The process of converting source code into machine code is called compilation. Machine language code is a set of instructions to be executed by the computer. It has to be converted into machine language code, which computers can easily understand and execute. Source code is very similar to human language, consisting of words and phrases. The program written by the programmer, known as source code, is not understood by the computer. To understand how Java facilitates platform independence, let us differentiate between the compilation process of other programming languages, mainly C/C++, and that of Java. Java is called Platform Independent because programs written in Java can be run on multiple platforms without re-writing them individually for a particular platform, i.e., Write Once Run Anywhere (WORA). The platform can be defined as a distinct combination of hardware, operating system, and software that provides an environment to run programs. What is a Platform, and What is a Platform-Independent Language? Thus, it is called a platform-independent programming language. Java provides a way to write applications independent of the hardware and operating systems. To tackle this diversity of platforms, such applications should be written independently for all platforms. Some applications are common to all operating systems, like MS Word, so should that be written separately for all the Operating Systems? Mac applications cannot run on the Android Operating system, and so on. For instance, Windows applications cannot run on Mac Operating System. IntroductionĬomputer programs are very closely related to specific hardware and operating system. JVM interprets the byte code to machine code, and the program is executed. This byte code is platform-independent and can run on any JVM operating system. Java compiler javac converts the program code into byte code. It supports platform independence using Java bytecode and Java Virtual Machine. Java doesn’t require the entire code to be rewritten for all the different platforms. It is a platform-independent programming language. Java is one of the most famous and extensively used programming languages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |