answersLogoWhite

0


Best Answer

A traditional compiler compiles the source code to machine language. Java compiles for a "ficticious CPU", not for a specific CPU (processor). The compiled code is called "bytecode" (technically, any information stored on a computer is made up of bytes!). To run the program, this bytecode is interpreted by the Java Virtual Machine.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

9y ago

Byte code is used in programming languages that are both compiled and interpreted. That is, high-level source code is compiled to an intermediate level byte code which is then interpreted to produce the low-level machine code. Java is a typical example. The Java compiler produces Java byte code which is suitable for interpretation by the Java virtual machine.

Byte code is highly portable. Unlike native machine code which is machine-dependent and must be recompiled separately for each supported platform, byte code is the native language of a virtual machine, one that is common across all supported platforms. As such, byte code need only be compiled once.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

JVM(Java virtual machine):it is the runtime environment for java programs and it contains the following :

1)class loader

2)byte code verifier

3)jit compiler and interpreter

java is a platform independent language which means it can be operated in any operating system

when you execute a program in C && C++ a .exe file is obtained which contains the source code

and operating system details where as when you execute a program in java a .class file is created which contains the byte code(source code) only.It is the JVM which links this byte code with the operating system details.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

The ExecutionEngine decodes the bytecode and performs the actions necessary to implement each instruction. Its interface is quite simple, consisting of a single function that takes a Context as an argument, and executes the method whose frame is on top of the Context's call stack.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

Traditional compilers compile to the machine language of a specific processor; Java compiles for a "fictitious processor" - according to the Java language specification. The result is called "bytecode", and is meant to be run by a program called the Java Virtual Machine (JVM).

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

The machine instructions that are interpreted by the virtual machine they are written for.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Java byte code refers to the set of instructions that the JVM can understand to generate the output that the programmer desires. This byte code is the output of the compilation process

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Bytecode is what the source code is compiled into. And the JVM (Java Virtual Machine) is what runs that bytecode.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is bytecode and java virtual machine in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How many bytes does a Java VM have?

A JVM, or Java Virtual Machine, creates the environment in which programs that run using Java bytecode are processed. It does not itself possess bytes or bytecode.


Java is both compiled and interpreted language meaning?

Instead of compiling to machine language, the Java compiler compiles for a "ficticious processor". A program called the Java Virtual Machine then interprets this on every machine. Note that Java is NOT an interpreted language. It is solely a compiled language. Java source code is always run through a compiler (typically 'javac') to be turned into bytecode. This is identical behavior as any other compiled language. The confusion is that Java bytecode is usually run on a Java Virtual Machine, which itself may both act as an interpreter and a compiler for the native instruction set the JVM runs on. However, the Java language itself is NOT dependent on how this bytecode is run - in fact, it is possible (and has been done) to build a hardware machine that runs Java bytecode directly.


Why java interpreted?

Java is both compiled and interpreted. At first, the Java source code (in .java files) is compiled into the so-called Bytecode (.class files). The Bytecode is a pre-compiled, platform independent version of your program. The .class files can be used on any operating system. When the Java application is started, the Bytecode is interpreted by the Java Virtual Mashine. Because the Bytecode is pre-compiled, Java does not have the disadvantages of classical interpreted languages, like BASIC.


Why java has compiler and interpreter both?

Java is both compiled and interpreted language.First Java source code has to be translated into Byte code, which is done with the help of a compiler.But these byte codes are not machine instructions. Therefore ,in second stage this byte code has to be translated into machine code.This task is performed by an Interpreter.Hence, Java use both compiler and interpreter.


Is it possible to run java program without JVM?

No. Java programs run in the Java Virtual Machine (JVM) - without it your computer won't know how to handle Java bytecode.

Related questions

How many bytes does a Java VM have?

A JVM, or Java Virtual Machine, creates the environment in which programs that run using Java bytecode are processed. It does not itself possess bytes or bytecode.


Does the bytecode is different for every processor?

No, Java bytecode, just like the source code, is universal. The only parts that changes between different architectures are the Java Runtime Environment and its sub-components (such as the Java Virtual Machine).


What type of file is created by Java?

Java created a file called class, and is identified by having the .class at the end. This file includes a Java bytecode, which then can be used on the Java Virtual Machine.


Java is both compiled and interpreted language meaning?

Instead of compiling to machine language, the Java compiler compiles for a "ficticious processor". A program called the Java Virtual Machine then interprets this on every machine. Note that Java is NOT an interpreted language. It is solely a compiled language. Java source code is always run through a compiler (typically 'javac') to be turned into bytecode. This is identical behavior as any other compiled language. The confusion is that Java bytecode is usually run on a Java Virtual Machine, which itself may both act as an interpreter and a compiler for the native instruction set the JVM runs on. However, the Java language itself is NOT dependent on how this bytecode is run - in fact, it is possible (and has been done) to build a hardware machine that runs Java bytecode directly.


What do you mean by java virtual machine explain?

A Java Virtual Machine enables a set of computer software programs and data structures to use a virtual machine model for the execution of other computer programs and scripts. The model used by a JVM accepts a form of computer intermediate language commonly referred to as Java bytecode. A virtual machine is a software implementation of a machine (i.e. a computer) that executes instructions (not programs) like a physical machine.


Why java interpreted?

Java is both compiled and interpreted. At first, the Java source code (in .java files) is compiled into the so-called Bytecode (.class files). The Bytecode is a pre-compiled, platform independent version of your program. The .class files can be used on any operating system. When the Java application is started, the Bytecode is interpreted by the Java Virtual Mashine. Because the Bytecode is pre-compiled, Java does not have the disadvantages of classical interpreted languages, like BASIC.


Why java has compiler and interpreter both?

Java is both compiled and interpreted language.First Java source code has to be translated into Byte code, which is done with the help of a compiler.But these byte codes are not machine instructions. Therefore ,in second stage this byte code has to be translated into machine code.This task is performed by an Interpreter.Hence, Java use both compiler and interpreter.


Is it possible to run java program without JVM?

No. Java programs run in the Java Virtual Machine (JVM) - without it your computer won't know how to handle Java bytecode.


Is MSIL similar to java byte code?

Yes, in some way it's similar. One difference is that Java Bytecode is typically interpreted by the virtual machine, while MSIL is JIT-compiled to native machine code before executing. However, it is increasingly common for bytecode to be compiled as well.


Why java called platform indeependent?

Platform independent language means once compiled you can execute the program on any platform (OS). Java is platform independent. Because the Java compiler converts the source code to bytecode, which is Intermidiate Language. Bytecode can be executed on any platform (OS) using JVM( Java Virtual Machine).


What is a bytecode?

In Java, "bytecode" is the name given to the compiled class files. The "compilation" in this case is not for a specific processor, but rather for a kind of fictional processor - and it is meant to be run by a Java Virtual Machine.


What do you get when you compile a java program?

The java interpreter or JVM (Java Virtual Machine) is not able to execute the java source code for a program. The java source code first needs to be compiled into bytecode that can be processed by JVM. Producing bytecode make the program platform independent as each platform has its own JVM. It is also possible to directly write bytecode, bypassing the need to compile, but that would be tedious job and also not good for security purpose as the compiler checks for various errors in a program.