1、本篇博客主要介绍关于if语句的一道面试题目
2、源码如下
package test;
public class Test {
public static void main(String[] args) {
/**
* 下面的输出语句可以输出吗?
*
* 可以,因为if(true)
System.out.println("yes"); 其实是一个语句,
而 if后面的紧跟的那一个语句是可以省略括号的。
*/
if(2==2)
if(true)
System.out.println("yes");
}
}