Here we can use :: foo1 (). This means that the foo1 () method is in the global namespace, am I right?
Yes, that's right. This means calling a method named foo1()
defined in the global namespace. This is called Qualified Namespace Lookup .
do "using namespace ANAMESPACE_NAME" means that we import all the elements in the ANAMESPACE_NAME namespace into the global namespace?
Yes, it imports all elements from the ANAMESPACE_NAME
namespace into the current namespace.
It is called using the directive .
If you want to import only a specific item in the current type, using the declaration .
Format
:
using ANAMESPACE_NAME :: element_name;
source share