Some little knowledge about getting started with java

1.//.........Indicates a single-line comment.

  /*.........*/ Represents a multi-line comment, and the commented content will not appear in the javadoc document.

  /** ...... */ Multi-line comments, the commented content is written into the javadoc documentation.

2. The bin directory of java: This directory is used to store executable command programs and is the directory where the command line tools are located. The main commands are as follows:

javac: Java compiler, used to compile Java source code, and compile *.Java source code files into *.class bytecode text, such as: Javac HelloWorld.Java -----> HelloWorld.class
java: Java interpreter , used to run the compiled Java bytecode file, such as: Java HelloWorld (note that the extension .class is not required)
javadoc: used to generate help documents for some documentation comments in the Java source code, such as: javadoc -dc: \help -author -version HelloWorld.java
            Description:
         -d: an empty space after it is used to specify the location where the generated help document is stored;
         -author: used to specify that the generated help document must display the author of the class, if not The help document generated by this command will not display the author;

         -version: It is used to specify that the generated help document must display the version of the class. Without this command, the generated help document will not display the version;

3. JVM virtual machine:

The Java Virtual Machine is a virtual machine process that can execute Java bytecode.

A program written in Java (stored in a file with the extension java) is compiled into a bytecode file (ie a file with the extension class) by the compiler (that is, the javac.exe file in the bin folder of the JDK root directory), This bytecode file is not for a specific platform, but for an abstract Java virtual machine. It runs on a Java virtual machine and installs different Java virtual machines on different types of platforms. These different Java virtual machines shield each The difference between different platforms makes the compiled Java program platform independent, that is, when the Java virtual machine executes the bytecode, it parses the bytecode into machine instructions for execution on a specific platform.


4. java working principle: first compile the java file, generate a class file, that is, a bytecode file, and then translate it into a binary language that the system can recognize.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324802622&siteId=291194637