java包结构反向域名有什么意义

What is the significance of the reverse domain name for java package structure(java包结构反向域名有什么意义)
本文介绍了java包结构反向域名有什么意义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

限时送ChatGPT账号..

为什么我们使用反向域名,如 com.something.或 org.something.java包的结构?我知道这会带来某种独特性,但我们为什么需要这种独特性呢?

Why do we use reverse domain name like com.something. or org.something. structure for java packages? I understand this brings in some sort of uniqueness, but why do we need this uniqueness?

推荐答案

全局唯一的包名避免了不同来源的库之间的命名冲突.不是创建一个新的全球名称中央数据库,而是使用域名注册.来自 JLS:

Globally unique package names avoid naming collisions between libraries from different sources. Rather than creating a new central database of global names, the domain name registry is used. From the JLS:

建议的约定生成唯一的包名称是只是一种捎带包裹的方法命名约定现有的、广为人知的唯一名称注册表,而不必创建一个包名称的单独注册表.

The suggested convention for generating unique package names is merely a way to piggyback a package naming convention on top of an existing, widely known unique name registry instead of having to create a separate registry for package names.

这篇关于java包结构反向域名有什么意义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Sending a keyboard event from java to any application (on-screen-keyboard)(将键盘事件从 java 发送到任何应用程序(屏幕键盘))
How to make JComboBox selected item not changed when scrolling through its popuplist using keyboard(使用键盘滚动其弹出列表时如何使 JComboBox 所选项目不更改)
Capturing keystrokes without focus(在没有焦点的情况下捕获击键)
How can I position a layout right above the android on-screen keyboard?(如何将布局放置在 android 屏幕键盘的正上方?)
How to check for key being held down on startup in Java(如何检查在Java中启动时按住的键)
Android - Get keyboard key press(Android - 获取键盘按键)