B
B
Tech Blogs
Search
K
Comment on page

Important Questions

What is bytecode ?

Every Java program is first compiled into an intermediate language called Java bytecode. Java applications must be capable of executing on a variety of hardware architectures and operating systems. To accommodate this, the Java Compiler (javac) generates bytecodes-- an architecture neutral intermediate format designed to transport code efficiently to multiple hardware and software platforms.

What is difference between Assembly Code and ByteCode ?

Assembly code means the human readable form of a machine code. Byte code on the other hand is normaly a language that can be interpreted by a byte code interpreter -- so it is not the processors native language.

What is JVM and do we have different JVM for different environment ?

A Java virtual machine (JVM) is an abstract computing machine that enables a computer to run a Java program. There are three notions of the JVM: specification, implementation, and instance.
  • The specification is a document that formally describes what is required of a JVM implementation. Having a single specification ensures all implementations are interoperable.
  • A JVM implementation is a computer program that meets the requirements of the JVM specification.
  • An instance of a JVM is an implementation running in a process that executes a computer program compiled into Java bytecode.
JVM is not platform independent, thats why you have different JVM for different operating systems.
The JVM is used primarily for 2 things:
  • Translate the bytecode into the machine language for a particular computer
  • Actually execute the corresponding machine-language instructions as well.
The JVM and bytecode combined give Java its status as a "portable" language – this is because Java bytecode can be transferred from one machine to another.