Why does Java call a file a class?

I'm just starting to study Java. I'm using Eclipse.

Java misunderstood that files (.java) are called "classes".

It was when I was using Terminal and VScode.

$ javac ○○.java

Where I ran Newly say "○○ .class" The file is ready.

javac means "compile Java".

$ java ○○

Next, when I executed it as above, the output was output to the terminal as expected.

Summary

By compiling, I found that I could do .class files.

If you use Eclipse, it will be processed all at once, so I was able to know what happened behind the scenes.

Recommended Posts

Why does Java call a file a class?
Why java allows final class A {abstract class B {}}
Write a class in Kotlin and call it in Java
[Java] Create a temporary file
[MQTT / Java] Implemented a class that does MQTT Pub / Sub in Java
Why are class variables needed? [Java]
Call Kotlin's sealed class from Java
Run a batch file from Java
What is a class in Java language (3 /?)
[Java] How to use the File class
What is a class in Java language (1 /?)
What is a class in Java language (2 /?)
Creating a matrix class in Java Part 1
Reading a file using Java's Scanner class
How to find out the Java version of a compiled class file
GetInstance () from a @Singleton class in Groovy from Java
Java class methods
[Java] Class inheritance
Read a string in a PDF file with Java
java Scanner class
Java HashMap class
Java method call from RPG (method call in own class)
java (abstract class)
How to convert a solidity contract to a Java contract class
[Java] Nested class
A story about trying to operate JAVA File
A bat file that uses Java in windows
About Java class
java file creation
A quick review of Java learned in class
[java] abstract class
[Java] Object class
Java local class
[Java] Let's create a mod for Minecraft 1.14.4 [0. Basic file]
I want to call a method of another class
How to jump from Eclipse Java to a SQL file
A quick review of Java learned in class part4
Write a class that can be ordered in Java
Call a method with a Kotlin callback block from Java
[Java] Let's create a mod for Minecraft 1.16.1 [Basic file]
I tried OCR processing a PDF file with Java
A quick review of Java learned in class part3
How to convert a file to a byte array in Java
A quick review of Java learned in class part2
Call a program written in Swift from Processing (Java)
Java11: Run Java code in a single file as is
[Java] File system operation
Call Java from JRuby
About class division (Java)
About Java StringBuilder class
Read Java Property file
[Java] About Singleton Class
java (split source file)
java core: chopped core file
java build a triangle
Java inner class review
Java class type field
Java programming (class method)
About Java String class
JAVA constructor call processing
Java programming (class structure)