Namespaces
In a Java method, each variable name can be declared only once.
-
You can have variables
aandb, but not two variables both calleda. -
In a different method however, you can also have variables
aandb.
Each method body is a namespace for its local variables.
namespace¶
A set of unique symbols allowing us to refer to things by name without ambiguity.
In a folder, we can have only one file of a given name.
- You can have
Hello.javaandHello2.javabut not two files both namedHello.java.
In the filesystem, a directory is a namespace for filenames.