Java day03

Annotation

                           注释

Regarding the comments in the Java source program:
*
How to write Java comments to enhance the readability of the source program ?
Single-line comment
// Comment only single
-line multi-line comment

                  /*注释多行
                  */
                  Javadoc注释:将来可以被Javadoc.exe解析,然后生成帮助文档
                  /**
                  *也叫注释
                  *	
                  *	/

Explanation of the source program:
public means public
class means defining a class
static means static
void means empty
main means the method name is main (string [] args) is a representation of the main method. The parameter list that
needs to be remembered is the following method It is the main method of a program and the entrance to the execution of the program. It
is stipulated by the Sun company. The fixed writing method is
public static void main (string [] args).
args can be written at will, and others can be written at will
. Direct is not allowed in the class body In addition to writing declarations, the
following program is called "method body" in the explanation. The
method body can be used to write multiple Java statements
system.out.println("Hello World");
the function of system.out.println is to think Terminal output
double quotes must be double quotes with half-width symbols

The difference between the title public calss \class

                   *  一个Java源文件的当中可以定义多个class
                   *   Java源文件当中不一定会有public 的 class
                   * 一个class会定义生成一个xxx.class的字节码文件
                   *  一个Java源文件当中定义公开的类的话,public的class只能一个,并且该类名称必须和Java源文件名称一致
                   *  每一个	class当中的都可以编写main方法,都可以设定程序的入口,比如:想执行B.class的mian方法:
                       直接:
                                -Java+空格+B	
                   * 注意:
                               挡在命令窗口中执行Java Hello,那么要求Hello.class必须得有主方法 。没有则会出现运行阶段的错误

This is the end of the content notes of the first chapter. Tomorrow we will continue to study the content of the second chapter and take notes.
Sleep, sleepy

Guess you like

Origin blog.csdn.net/weixin_53515338/article/details/114954355