gpt4 book ai didi

java - 指定 line.separator 作为编译器设置?

转载 作者:行者123 更新时间:2023-12-01 17:24:45 26 4
gpt4 key购买 nike

根据this answer的建议:

You can call

System.setProperty("line.separator", "\r\n");

in order to set the system property inside your code.

让 Java 程序输出所需的行结尾非常容易。但是,我认为没有理由不能更改该环境变量,例如作为编译器设置?

最佳答案

因为这根本不是怎么回事 environment variables根据定义,工作。环境变量由运行时环境决定,而不是由编译器或任何编译时设置决定。

Many operating systems use environment variables to pass configuration information to applications. Like properties in the Java platform, environment variables are key/value pairs, where both the key and the value are strings. The conventions for setting and using environment variables vary between operating systems, and also between command line interpreters.

关于java - 指定 line.separator 作为编译器设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15887094/

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