Compiling Java Program Just By Looking At.

Compiling Java Program Just By Looking At.

What is Compilation How it is used in Hello world Program?

As I mentioned in my last blog, I covered the basics of the Hello World program in Java. Today I'm covering a compilation, which turns source code into machine code.

https://hashnode.com/post/cle9n6eo4000309mu8i0u9iar

When we compile a Java program, the compiler takes all of the source code(Input) and turns it into executable machine code(Output). This process is called compilation. Java is an object-oriented language, so the compiler takes all our class files and creates individual executables for each class. The compiler also translates all of the variables and functions into their equivalent machine code. These programs can be executed on a variety of different platforms, including computers, mobile phones, and embedded systems. The user interacts with the system using a command line interface, which allows the user to interact with the system and perform tasks such as executing a program or opening a new document.

Java is a low-level language that can be compiled as well as interpreted. The Java compiler is a program called javac that converts.javafiles (source code) into .class files(machine code), which contains the resulting byte code(machine code). The Java interpreter is a separate program called java, which stands for Java Virtual Machine (JVM). The programmer writes source code in the file Hello.java and compiles it with javac. If there are no errors, the compiler saves the byte code, which the programmer interprets using Java.

The program's output is then displayed on the screen. Most development environments automate these steps, but it is critical to understand what steps are taking place during the development process.

Did you find this article valuable?

Support Sumit Kumar by becoming a sponsor. Any amount is appreciated!