Tech Blogs
  • Vivek bhargav
  • Books
    • Seven Databases In Seven Weeks
      • Factors to consider
      • Genres of databases
      • Important questions
      • PostGreSQL
  • Tech
    • C++
      • Type Conversions
      • String
      • Vector
      • Set
      • Unordered Set
      • Map
      • Unordered Map
      • Queue
      • Priority Queue
      • Union find
      • Algorithms
      • Matrix to Graph
      • Trie
      • Dijkstra
      • Math
      • Utils
    • Database Transactions
      • A Simple Transaction Analysis
      • Implementation of Isolation Levels
      • Isolation Levels
      • Isolation
      • Storage Types
      • Transaction Atomicity and Durability
    • Java
      • Important Questions
      • Spring MVC
    • Program execution
      • Node.js
      • Runtimes
    • System Design
      • Basic Terminologies
      • CAP Theorem
      • Normalization of Database
      • Useful Reads
  • Personal Finance
    • Asset Classes
      • Equity instruments
      • Debt instruments
Powered by GitBook
On this page
  • What is bytecode ?
  • What is difference between Assembly Code and ByteCode ?
  • What is JVM and do we have different JVM for different environment ?
  1. Tech
  2. Java

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.

PreviousJavaNextSpring MVC

Last updated 2 years ago