日期:2014-05-20 浏览次数:20709 次
public static void main(String[] args) { System.out.println("outer Before"); { boolean i; if (i = false) { { //code System.out.println("inner IF"); } } else{ System.out.println("outer ELSE " + i); } System.out.println("outer After"); } }
public static void main(String[] args) { System.out.println("outer Before"); { { boolean i; if (i = false) { { //code System.out.println("inner IF"); } } } else{ System.out.println("outer ELSE " + i); } System.out.println("outer After"); } }
public class Test { //{1}..start public static void main(String[] args) { //{2}..start System.out.println("outer Before"); { //{3}..start boolean i; if (i = false) { //{4}..start { //{6}..start System.out.println("inner IF"); } //{6}..end } //{4}..end else { //{5}..start System.out.println("outer ELSE " + i); } //{5}..end System.out.println("outer After"); } //{3}..end } //{2}..end }//{1}..end //以上全是标准嵌套,切else块{5} 紧跟在块{4}之后