文档介绍:java课堂笔记(java课堂笔记)
Monday: towards the abyss;
Tuesday: endless road;
Wednesday: before dawn;
Thursday: life and death struggle;
Friday: the darkness before dawn;
Saturday: escape from the tiger's jaws;
Sunday: happy bachelor;
Diploma / Diploma examination / self examination office / computer application, work, merce
One
Indicate starting from this directory;
Do not add "No." to the 2. if statement!
The following: if if (I = = stop) break, with a semicolon (.
If (I = = stop); break; then piler error, but not check out, pay attention to;
3. continue statement usage:
Int skip = 5;
For (int i = 1; I < 5; i++) {
If (I = = skip) continue;
("i=" + I);
}
The use of 4. for statements, such as:
For (int i=0; I 5; i++) {... };
Pay attention to the semicolon!!!
The execution process: first calculate the expression, and then judge the expression 2, then execute the method statement, and then execute expression 3, and then judge the expression 2, and then execute the method...... By this cycle. (the expression is calculated once.)
5. while statement form:
While (logical expression) {statement}
Execution process:
First determine the value of the logical expression. If =true., then the statement behind the executor, and then again judge the conditions and repeated execution until the condition is untenable.
6. while do statement:
Do{statement:...... }while (logical expression);
Execution process:
First execute the statement, then judge the value of the logical expression, if true, then execute the statement, otherwise the end of the cycle.
7. compare while, if, for; while and for are cyclic types; if is a one-time statement.
8. switch (I) means that the value of I is detected; the value of I can only be of int type (including automatically converted to int type, such as Chr shirt bate; examples):
Public class Testswitch {
Public static void main (String args[]) {
Int i = 3;
Switch (I) {
Case 8:
("A");