1.main method.
------Any Java program has a main method, which is the entry for the program.
------When the Java + Class name command is executed, the JVM loads the class, looks for the main method in the class, and then executes the entire program from the main method.
------Note: The main method is called to the JVM, and we do not call this method when we write the program.
------There is only one main function in a class.
2.public
------"Class + class name" before adding public, it is necessary to keep the class name and file name consistent.
3. A software often has two instructions, one is the software specification, the other is the user manual.
4. Comment function
------The annotation Description program.
------Debug Program.
5. Code is just a form of thought, computer language is just to express our thoughts, so we must first have ideas before programming. Write the comments before------write the code. This step is quite related to demand analysis and design.
/*
Requirements: The purpose of this piece of code
Thinking: The idea of solving the problem
1. How to Think
2. How to Think
3. How to Think
Steps: Implementation Steps
1. What code is used to implement
2. What code is used to implement
3. What code is used to implement
*/
6. Modulo operator
------expressed in%.
------that the remainder is obtained.
------For example,
int a=5;
int b=3;
int c=a%b;
Compile execution c=2
Because 5 divided by 3 results is more than 1 2.
------Another example,
int a=-5;
int b=3;
int c=a%b;
Compile execution c=-2
Because 5 divided by 3 results is-1-2.
.
------Another example
int a=5;
int b=-3;
int c=a%b;
Compile execution c=2
Because 5 divided by-3 result is-1 more than 2.
------The rule of modulus, the result of modulo is always the same as the sign of the divisor.
Dividend is 5, the result of modulo is 2.
If it is-5, then the remainder result is-2
7. String data and any data connected using "+" will eventually become a string.
------such as SYSTEM.OUT.PRINTLN ("5+6=" +5+6);
The output is------
5+6=56
8. The plus () brackets increase the priority level.
------such as SYSTEM.OUT.PRINTLN ("5+6=" + (5+6));
The output is------
5+6=11
。 Some small details in Java