What is the difference between source code and bytecode




















So you can use completely different source languages than java, and still enjoy all the libraries and frameworks and advanced technologies that the JVM has to offer! Show 2 more comments. Active Oldest Votes. Improve this answer. Yugansh Yugansh 2 2 silver badges 8 8 bronze badges.

That's pint, Java source code is cross platform, just like byte-code. Source code , is the textual or high level program that we write , so yes if the text can be read and compiled and run by your device say mobile , then its cross -platform. Java Designers want to keep executing environment light so the didn't want compiler to be part of JRE , and just created a lighweight executable environment which could translate the byte code generated by compilation of source code — Yugansh.

There are a lot of languages other than Java that run on the JVM. And even within Java, you get a whole lot of custom compiler extensions via annotation processing. All these things compile into bytecode, and you can run it without needing to know what language was used to create the program. Show 1 more comment. The Overflow Blog. Her areas of interests in writing and research include programming, data science, and computer systems.

Your email address will not be published. Figure Program Execution in Java. Leave a Reply Cancel reply Your email address will not be published. Source Code vs Bytecode. The Source Code is a collection of computer instructions written using a human-readable programming language.

The Bytecode is the intermediate code between source code and machine code that is executed by a virtual machine. Source Code is readable by the human or the programmer. The Byte Code is readable by the virtual machine. The source code is in the form of plain text with English similar syntax and comments. Method of Execution. The source code is not directly executable by the machine.

The bytecode is executable by a Virtual Machine. Execution Speed. The speed of the source code is minimum than the bytecode. The speed of bytecode is faster than source code. The performance of the source code is not much as compared to a bytecode. The main difference between machine code and bytecode is that the machine code is a set of instructions in machine language or binary that can be directly executed by the CPU while the bytecode is an intermediate code generated from compiling a source code which can be executed by a virtual machine.

A computer program is a collection of instructions that perform a specific task. A special software such as compilers or interpreters transforms the program into a machine-readable machine code. On the other hand, bytecode is not a native machine code; it is a portable code. Moreover, a software such as a virtual machine can execute it directly.

What is Machine Code — Definition, Functionality 2. What is Bytecode — Definition, Functionality 3. Machine code is a set of instructions in machine language. The CPU can directly execute it. These languages have a syntax similar to English language and it is easier for the programmer to read and understand.

Previous Composition in Java. Recommended Articles. Article Contributed By :. Easy Normal Medium Hard Expert. Writing code in comment? Please use ide.

Load Comments.



0コメント

  • 1000 / 1000