+ 1
What does namespace mean?
10 Antworten
+ 1
It allows you to use the same function or class name in different parts of the same program without causing a name collision.
In simple terms, think of a namespace as a person's surname. If there are two people named "John" you can use their surnames to tell them apart.
+ 2
https://code.sololearn.com/w5GueTR0Sf7x/?ref=app
see this, this will better help you understand. upvote if it helps.
+ 2
yep, totally. although it's not available in C.
https://code.sololearn.com/cPR3Eg7asfcP/?ref=app
+ 1
A namespace is used to uniquely identify one or more names from other similar names of different objects, groups or the namespace in general. Namespace makes it possible to distinguish objects with similar names but different origins
+ 1
But what is it meant for?
+ 1
OK...thank you😄
+ 1
Is this applicable for C++ too?
+ 1
Do we write 'using namespace std; in C++ for this very purpose?
+ 1
Packages and the Java Namespace. A package is a named collection of classes (and possibly subpackages). Packages serve to group related classes and define a namespace for the classes they contain. ... The String class, for example, is part of the java.lang package, so its fully qualified name is java.lang.String.
namespace is a declarative region that provides a scope to the identifiers (the names of types, functions, variables, etc) inside it. Namespaces are used to organize code into logical groups and to prevent name collisions that can occur especially when your code base includes multiple libraries.
https://msdn.microsoft.com/en-us/library/5cb46ksf.aspx
Namespace is a feature added in C++ and not present in C. A namespace is a declarative region that provides a scope to the identifiers (names of the types, function, variables etc) inside it. Multiple namespace blocks with the same name are allowed. All declarations within those blocks are declared in the named scope.
https://www.geeksforgeeks.org/namespace-in-c/
https://www.geeksforgeeks.org/difference-namespace-class/
0
yep, you're right