Repaso
EspaƱol
Java CoreFoundationsJV-43

What is the JVM (Java Virtual Machine)?

Options

  1. A program that runs bytecode between your code and the OS (Correct option)
  2. An editor that writes and checks the Java source code
  3. A cloud server that hosts Java applications for you
  4. A database that stores Java objects between the runs

Answer

A program that runs Java bytecode and sits between your program and the operating system, so the same .class files run on Windows, Linux or macOS

Why

Bytecode is not tied to a specific processor or operating system. Each operating system has its own JVM that knows how to run it.

This is the idea behind 'write once, run anywhere'.

The JVM also manages memory for you: it creates objects and the garbage collector removes the ones no longer used.

Remember

JVM = the engine that runs Java bytecode on any OS.

Key terms

Practice this question in Repaso