合格是什么意思? [英] What does qualify mean?

查看:89
本文介绍了合格是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在阅读有关编程的文章,手册等...时,我总是会遇到 qualified 这个词。像在Java中一样,完全限定的类名称为com.example.Class。读取
这篇文章将C ++中的范围解析运算符 :: 定义为用于限定隐藏名称,以便您仍然可以使用它们。这个有定义吗?因为它似乎每次都在不同的上下文中使用。

When reading articles, manuals, etc... about programming, i always come across the word qualified. like in java the fully qualified class name would be com.example.Class. Reading this article, defines the scope resolution operator :: in C++ as being used to Qualify hidden names so you can still use them. Is there a definition for this ? Beccause it seems to be used in a different context each time.

推荐答案


在计算机编程中,完全限定的名称是 明确的名称
,它指定调用引用哪个对象,函数或变量,而不考虑调用上下文。在
层次结构中,当名称完整的
包含以下含义时,它是完全限定的:(a)层次结构序列
中的所有名称都位于给定元素之上,并且(b)给定元素
本身的名称。因此,完全限定的名称显式地引用了命名空间
,由于调用范围,该命名空间否则将是隐式的。
尽管总是会消除歧义,但这可能意味着依赖上下文的
事物有所不同。

In computer programming, a fully qualified name is an unambiguous name that specifies which object, function, or variable a call refers to without regard to the context of the call. In a hierarchical structure, a name is fully qualified when it "is complete in the sense that it includes (a) all names in the hierarchic sequence above the given element and (b) the name of the given element itself." Thus fully qualified names explicitly refer to namespaces that would otherwise be implicit because of the scope of the call. While always done to eliminate ambiguity, this can mean different things dependent on context.

来源维基百科

简而言之,是什么意思

您的项目中可以有一个名为 Math 的类,但 Math

You can have a class named Math in your project, but Math is already present in Java too.

因此,要明确确定您实际上指的是哪个类,也需要使用包对名称进行限定:

So for unambiguously identifying which class you are actually referring to you need to qualify the name with package too:

java.lang.Math //refers to java class Math
org.myproject.Math //refers to your project Math class

这篇关于合格是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆