From now on, I would like to write an article about the syntax from the basic Java processing flow. For those who want to know Java from scratch and want to study,
This time, I will explain the flow of Java operation. It's like an overview. ~~ This time, whether you know it in detail or not, it's surprisingly pretty lol ~~
I would like to start writing about programming next time.
Roughly speaking, from the creation of Java programs to the movement
First of all, create a file. In Java, the extension [.java] is fixed, so in the example, a file like Hoge.java is created. And the file in which the program is written is called "** source code **". I will write the program, but I will write the details in a later article.
Source code can be created and edited basically with a text editor included in the OS, but it is very convenient to use program development software called an integrated development environment (IDE). Example) Eclipse, NetBeans etc ... Using an IDE has the advantages of beautifully formatting, predictive conversion, and easy file management, and is often used at development sites.
The source code is for human understanding only, and the computer cannot execute the process as it is. So you need to convert it so that your computer can understand it.
The process of conversion is called "** compilation **". The command to compile is "javac file path / filename.java" (Through is OK if you are using IDE)
Then, the compiled source code is called "** bytecode **", and a [.class] file is created. This bytecode is an intermediate language that runs on the JVM (Java Virtual Machine).
The JVM is a virtual computer between your program and your computer. Thanks to the JVM, it can be run on Windows, Mac OS, Linux, etc. without any special settings.
"Write Once, Run Anyware" (once programmed, it works in any environment) This is a Java concept, but it feels like it's done in the JVM. ~~ Did you derail a little? Lol ~~
In Java, bytecode is converted to "** native code **" on the JVM, and the computer understands and executes this native code. The command to execute is "java class name" (Click the "Execute" button in the IDE)
Summary,
Source code (.java) ↓ Compile Bytecode (.class) ↓ JVM Native code ↓ Computer Run
It will be the flow.
Basically, programming languages are divided into interpreter method and compiler method, but Java is different from other languages in both interpreter and compiler methods ... I feel that it has both properties.
This time, I will describe only the process up to execution and do not touch on programming, but I would like to start programming from the next time onwards.
Next time → "Study Java-Part 1-Hello World"
Recommended Posts