• Post Reply Bookmark Topic Watch Topic
  • New Topic

Name Space in Java  RSS feed

 
Sri Ram
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please tell me what is a namespace in Java and also the use of it ?.Sorry if it is a very basic question.Thanks in advance.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically, a namespace is the "space" in which a "name" is valid. In Java, packages are used to define namespaces for classes and interfaces.

For example, within the package (namespace) java.util, "List" identifies a particular interface. But within the package java.awt, "List" identifies an entirely different class. This can be resolved either by using fully qualified names (like java.util.List) or by careful use of import statements.
 
Sri Ram
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marc
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!