for(show(‘a‘); show(‘b‘) && x<3; show(‘c‘))

for(show(‘a‘); show(‘b‘) && x<3; show(‘c‘)),第1张

for(show(‘a‘); show(‘b‘) && x<3; show(‘c‘))

        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;
}
}

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/zaji/3971624.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-10-21
下一篇 2022-10-21

发表评论

登录后才能评论

评论列表(0条)

保存