Bytecode in Java (जावा में बाइटकोड)
Bytecode is an intermediate, platform-independent code generated by the Java compiler from Java source code. It is stored in a file with the .class extension. The Java Virtual Machine (JVM) executes this bytecode using an interpreter and Just-In-Time (JIT) compiler.
Bytecode एक Intermediate तथा Platform-Independent Code है, जिसे Java Compiler द्वारा Java Source Code से Generate किया जाता है। यह .class Extension वाली File में Store होता है। Java Virtual Machine (JVM) इस Bytecode को Interpreter तथा Just-In-Time (JIT) Compiler की सहायता से Execute करती है।
How Java Bytecode Works? (जावा बाइटकोड कैसे कार्य करता है?)
Java Bytecode works through the following steps:
Source Code: A programmer writes a Java program in a
.javafile.Compilation: The Java compiler (
javac) converts the source code into bytecode.Class File: The generated bytecode is stored in a
.classfile.Execution: The JVM loads and verifies the bytecode and executes it using interpretation and JIT compilation.
जावा बाइटकोड निम्नलिखित चरणों में कार्य करता है:
Source Code: प्रोग्रामर Java Program को
.javaFile में लिखता है।Compilation: Java Compiler (
javac) Source Code को Bytecode में Convert करता है।Class File: Generate हुआ Bytecode
.classFile में Store होता है।Execution: JVM Bytecode को Load तथा Verify करके Interpreter और JIT Compiler की सहायता से Execute करती है।
Example of Java Bytecode (जावा बाइटकोड का उदाहरण)
Java Source Code:
class Hello {public static void main(String[] args) {System.out.println("Hello Java");}}
Compilation Command:
javac Hello.javaThis command generates a file named Hello.class, which contains Java Bytecode.
यह Command Hello.class नाम की File Generate करती है, जिसमें Java Bytecode होता है।
Execution Command:
java HelloOutput:
Hello JavaImportant Features of Bytecode (बाइटकोड की मुख्य विशेषताएँ)
Platform Independent: Can run on different systems with a compatible JVM.
Intermediate Code: Generated between source code and machine code execution.
Secure: JVM verifies bytecode before execution.
Portable: Can be transferred between compatible systems.
Efficient Execution: JIT compilation helps improve execution performance.
Platform Independent: Compatible JVM वाले विभिन्न सिस्टम पर चल सकता है।
Intermediate Code: Source Code और Machine Code Execution के बीच की Code होती है।
Secure: JVM Execution से पहले Bytecode को Verify करती है।
Portable: Compatible Systems के बीच स्थानांतरित किया जा सकता है।
Efficient Execution: JIT Compilation Execution Performance को बेहतर बनाती है।
Java Bytecode is the main reason behind Java's platform independence. It allows the same compiled Java program to run on different operating systems without recompiling the source code for each platform, provided a compatible JVM is available.
Java Bytecode, Java की Platform Independence का मुख्य आधार है। इसकी सहायता से एक ही Compiled Java Program को अलग-अलग Operating Systems पर Source Code को दोबारा Compile किए बिना चलाया जा सकता है, बशर्ते वहाँ Compatible JVM उपलब्ध हो।
Comments
Post a Comment