如果我没有与我关联的域,我应该如何命名包?

时间:2023-05-05
本文介绍了如果我没有与我关联的域,我应该如何命名包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

限时送ChatGPT账号..

所以大多数 Java 资源在谈到包时都会提到 com.yourcompany.project 设置.但是,我不在公司工作,也没有网站.是否有任何通用的命名约定?一个电子邮件地址,也许?

So most Java resources when speaking of packages mention a com.yourcompany.project setup. However, I do not work for a company, and don't have a website. Are there any naming conventions that are common? An email address, perhaps?

推荐答案

使用像bernard"这样的顶级域名或其他独特的域名.重要的部分是域是唯一的,这样可以避免冲突,而不是从真正的 Internet 顶级域开始,如 org 或 com.例如

Use a top-level domain like 'bernard' or something else unique. The important part is that the domain is unique so that you avoid clashes, and not that it starts with a real Internet top-level domain like org or com. E.g.

import java.util.*;
import bernard.myProject.*;
import org.apache.commons.lang.*;

这篇关于如果我没有与我关联的域,我应该如何命名包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

上一篇:控制对“.internal"访问的最佳实践包裹 下一篇:如何在 Java 中使用 3rd 方包

相关文章