// 1. The output b.sout
// 2. Negative Boolean expression. b.not or b.else
// 3. Boolean expressions. b.if
//. 4. x.nn or not empty is determined x.notnull
//. 5. is empty judgment x.null
// Optional.ofNullable. 6 (S) s.opt
//. 7. Return value x1.return
// 1. traversing values.for or values.iter
// 2. forward loop for 10.fori
//. 3. for the reverse cycle 100.forr
//4.while cycle b.while
. 1 // postfix suffix 2 @RequestMapping ( " / getPostfix " ) . 3 @ResponseBody . 4 public Optional The <String> getPostfix () { . 5 // postfix suffix . 6 the System. OUT .println ( " postfix suffix " ); . 7 Boolean B = to false ; . 8 String S = " 100 " ; . 9 10 // 1. output b.sout . 11 String A = " 1. output b.sout" ; 12 is the System. OUT .println (A); 13 is 14 // 2. Negative Boolean expression b.not or b.else. 15 IF (! B) { 16 the System. OUT .println ( " 2. Negative Boolean expression . b.not formula or b.else " ); . 17 } 18 is . 19 // . 3. Boolean expression b.if 20 is IF (B) { 21 is . the System OUT .println ( " . 3. Boolean expression b.if " ); 22 } 23 is 24 //4. Analyzing x.nn or non-empty x.notnull 25 IF (S =! Null ) { 26 is the System. OUT .println ( " 4. Analyzing s.nn not empty or s.notnull " ); 27 } 28 29 // The empty judgment x.null 30 IF (S == null ) { 31 is the System. OUT .println ( " The empty judgment s.null " ); 32 } 33 is 34 is // . 6 Optional.ofNullable (S) S .opt 35 Optional The <String> X1 =Optional.ofNullable (S); 36 . The System OUT .println (X1); 37 [ 38 is // 7. The return value x1.return 39 return X1; 40 }
. 1 // postfix cyclic suffix Example 2 public void getFor () { . 3 Boolean B = to false ; . 4 int [] = {values. 1, 2,. 3 }; . 5 // 1. traversal values.for or values.iter . 6 for ( int value: values) { . 7 . 8 } . 9 for ( int value: values) { 10 . 11 } 12 is // 2. forward loop for 10.fori 13 is for ( int I = 10; I> 0; i-- ) { 14 15 } 16 // 3 for reverse circulation 100.forr . 17 for ( int I = 10; I> 0; i-- ) { 18 is . 19 } 20 is // 4.while cycle b.while 21 is the while (B) { 22 is 23 is } 24 }