gpt4 book ai didi

java - 如何检测 Java System.out 是否是终端?

转载 作者:行者123 更新时间:2023-11-30 09:48:19 24 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
How can I check if a Java program's input/output streams are connected to a terminal?

我希望能够让一个问题在以交互方式运行时与以自动方式运行时表现不同。在 Python 中,您可以使用 sys.stdout.isatty 来检测这一点(参见 this question )。 Java 中有等效项吗?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com