gpt4 book ai didi

oop - 如果我的域有一个破折号,我应该怎么做我的包裹?

转载 作者:行者123 更新时间:2023-12-04 06:14:18 26 4
gpt4 key购买 nike

包的约定是您的域名。有时不允许在包名称中使用破折号。那么,如果您的域名有一个破折号,您应该使用什么?

最佳答案

Java 中的“官方”约定是用下划线替换它。

来自(旧版本)规范:

In some cases, the internet domain name may not be a valid package name. Here are some suggested conventions for dealing with these situations:

If the domain name contains a hyphen, or any other special character not allowed in an identifier (§3.8), convert it into an underscore. If any of the resulting package name components are keywords (§3.9) then append underscore to them. If any of the resulting package name components start with a digit, or any other character that is not allowed as an initial character of an identifier, have an underscore prefixed to the component.

关于oop - 如果我的域有一个破折号,我应该怎么做我的包裹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7448202/

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