How Java Works

Learning a new language is indeed a difficult task. But with a precise chronology and an excellent comprehensive guide, acquiring the skillset can be easy. Before trying to make long sentences, one should get well equipped with the basics of the language. The same pattern goes for Java. Before writing 1000 lines of code, we should try to figure out what happens in the background when you hit that run button or How does your code gets compiled!

How does a Java program actually executes?

  • First, you need to create a Java file and write code. You can do it either using a text editor or IDE (integrated development environment) and save as XYZ.java.
  • Secondly, you compile the Java file using the JAVAC compiler. It converts the source into bytecode and generates an XYZ.class file.
  • This XYZ.class file runs with the help of JVM (Java virtual machine).
  • The JVM first translates the class file into the computer readable machine code and then executes it.


Installing Java JDK and IDE Previous Next Important Java Terminologies