Studying Java-Part 0-Overview

1.First of all

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.

2. Programming flow

Roughly speaking, from the creation of Java programs to the movement

2-1. Creating a program

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.

2-2. Compile

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 ~~

2-3. Execution

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)

3. Conclusion

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

Studying Java-Part 0-Overview
Studying Java-Part 4-Literal
Studying Java-Part 5-Constant
Studying Java-Part 2-Variables
Studying Java-Part 9-Scope
Studying Java-Part 7-Array
Studying Java-Part 3-Type
Studying Java-Part 10-if statement
Studying Java-Part 1-Hello World
Studying Java-Part 11-switch statement
Studying Java ―― 3
Studying Java ―― 9
HTML.CSS.JavaScript.Ruby.Rails Overview
Studying Java ―― 4
Studying Java -5
Studying Java ―― 1
Studying Java # 0
Wagby Overview
Studying Java ―― 8
Studying Java ②
Studying Java ―― 7
Studying Java ―― 2
Studying Java ①
Studying Java -10