Thread: C++ Programming
View Single Post
Old 03-10-2005, 09:20 AM   #9 (permalink)
developer
 
Junior Techie

Join Date: Dec 2004

Posts: 88

developer

Default

Iron_Cross is right. Even in VB.net or ASP.net we import namespaces. Its a way of shortening the code. In case of C# its using followed by the namespaces name.
We write Console.WriteLine as namespace 'System' is automatically loaded.

If you make a new namespace 'mySpace' with some class 'square'. You can import this and directly call functions in it. Eg if there was a function Area(sidelength) which was SHARED. Then you could directly call it Area(5) wherever you imported the name space. C# namespace can be imported in VB.net and Vice versa. The same holds true for other languages too.

Even in general programming the namespace has to be imported to call the function directly/in shorthand.

Eg if you have to write Dim abc As New Thread, then you import System.Threading. Otherwise you have to write the complete thing.
You may not Import Std namespace cause it might be imported by default, just as 'System' namespace is.
__________________
Somewhere I Belong...
developer is offline