少年佳节倍多情,老去谁知感慨生。——殷尧藩《端午日》
很好奇,试了一下,真的可以。只是看起来怪怪的。
public static void main(String[] args) {
boolean b;
if (b = 1 == 1 ? true:false) {
System.out.println("executing");
}
}
//+++++++++++++++++++++++++++
executing
Process finished with exit code 0