show()方法是返回Boolean类型数值的,用作for循环的初始语句,只能说,我又涨见识了。果然代码世界有无穷的快乐,强颜欢笑😊
其实这个代码我没看懂,各位懂吗?
附上完整代码:
//写出下面代码的运行结果
class Demo{
public static void main(String[] args){
int x = 1;
for(show('a'); show('b') && x<3; show('c')){
show('d');
x++;
}
}
public static boolean show(char ch){
System.out.print(ch);
return true;
}
}