Post on 04-Jun-2018
8/13/2019 Name Spaces in .NET
1/3
8/13/2019 Name Spaces in .NET
2/3
Visual Studio.NET
Best Articles
"# "ode
usingSystem7namespace"ooks- namespaceInentory -
classAddInentory - publicoidMyMethod34 - &onsole.0rite5ine3(Adding Inentory ia MyMethod6(47 / / //
That+s all it takes to create namespace. 5et+s look ho! !e can use the namespaces in our code. I+mgoing to create a standalone program to use the namespaces.
VB.NET "ode
ImportsSystem&lass'ello0orld1ublicSubMain34
imAddIn AsInentory.AddInentory 8 Ne!AddInentoryAddIn.MyMethod34
$ndSub$nd&lass
$%
ImportsSystem.Inentory&lass'ello0orld 1ublicSubMain34 imAddIn AsAddInentory 8 Ne!AddInentory AddIn.MyMethod34
$ndSub$nd&lass
"# "ode
using"ooks7class'ello0orld- public static oid Main34 - Inentory.AddInentory AddIn 8 ne!AddInentory347 AddIn.MyMethod347 /
/
$%
using"ooks.Inentory7class'ello0orld- public static oid Main34 - AddInentory AddIn 8 ne!AddInentory347 AddIn.MyMethod347
Ravi Varma Thumati Page 2 11/19/2013
8/13/2019 Name Spaces in .NET
3/3
Visual Studio.NET
Best Articles
//
Note0hen using Imports statement or 9sing statement !e can use only the namespace names, !ecan+t use the class names. 2or e%ample, the follo!ing statements are in&alid.
Imports"ooks.Inentory.AddInentory
using"ooks.Inentory.AddInentory7
Final Notes
The namespaces are building blocks for the .N$T !ay of soft!are deelopment. The namespaces !ideopens the doors for :+d party and project specific custom components and class libraries.
Ravi Varma Thumati Page 3 11/19/2013