SlideShare a Scribd company logo
C# Tutorial
Part 1:
Using statement
www.sirykt.blogspot.com
• The using keyword has two uses:
• Create an alias for a namespace (a using alias).
• Permit the use of types in a namespace, such that, you do not have to qualify the use
of a type in that namespace (a using directive).
• Java programmers should note that, we could use namespace first, followed by using
or vice versa.
• The only purpose of the using command in this context is to save you typing and
make your code simpler.
• It does not, for example, cause any other code or libraries to be added to your
project.
• If your code uses base classes, you need to ensure separately that the compiler knows
which assemblies to look in for the classes (/r switch in the compiler).
• Implement the "using" Directive
• Next, we'll write a console application that uses the Hello class. We could just use the
fully qualified name for the class-arun.CSharp.Namespaces.
• Hello-but this name is quite long and unwieldy.
• An easier way is to use a "using" directive, which makes it possible to use all of the
types in a namespace without qualification.
• If you would like to call methods without typing their fully qualified name, you can
implement the "using" directive.
• using system;
using arun.CSharp.Namespaces;
class Hello
{
• static void Main()
{
• Hello m = new Hello ();
System.Console.WriteLine(m.GetMessage());
• } }
• "using System", is the same "using" directive you have seen in every program in this
article. It allows you to type the method names of members of the "System"
namespace without typing the word "System" every time.
• In class Hello(), "Console" is a class member of the "System" namespace with the
method "WriteLine". It's fully qualified name is "System.Console.WriteLine(...)".
• Note that the two occurrences of Hello are shorthand for
arun.CSharp.Namespaces.Hello. C# also enables the definition and use of aliases.
• Such aliases can be useful in situation in which name collisions occur between two
libraries, or when a small number of types from a much larger namespace are being
used.
• Using alias directives
• A using-alias-directive introduces an identifier that serves as an alias for a namespace or type within
the immediately enclosing compilation unit or namespace body.
• using identifier = namespace-or-type-name ;
• Within member declarations in a compilation unit or namespace body that contains a using-alias-
directive, the identifier introduced by the using-alias-directive can be used to reference the given
namespace or type.
• For example:
namespace N1.N2
{class A {}
• }
namespace N3
{using A = N1.N2.A;
class B: A {}
• }
• Here, within member declarations in the N3 namespace, A is an alias for N1.N2.A, and thus class
N3.B
derives from class N1.N2.A. The same effect can be obtained by creating an alias R for N1.N2 and
then
referencing R.A:
• namespace N3
{using R = N1.N2;
class B: R.A {}
• }
• The identifier of a using-alias-directive must be unique within the declaration space of the
compilation unit or namespace that immediately contains the using-alias-directive.
• Using namespace directives
• A using-namespace-directive imports the types contained in a namespace into the immediately
enclosing compilation unit or namespace body, enabling the identifier of each type to be used without
qualification.
• using-namespace-directive:using namespace-name ;
• Within member declarations in compilation unit or namespace body that contains a using-
namespace-directive, the types contained in the given namespace can be referenced directly.
• For example:
namespace N1.N2
{
• class A {}
• }
namespace N3
{
• using N1.N2;
class B: A {}
• }
• Here, within member declarations in the N3 namespace, the type members of N1.N2 are directly
available, and thus class N3.B derives from class N1.N2.A.
• Like a using-alias-directive, a using-namespace-directive does not contribute any new members to
the underlying declaration space of the compilation unit or namespace, but rather affects only the
compilation unit or namespace body in which it appears.
• The namespace-name referenced by a using-namespace-directive is resolved in the same way as the
namespace-or-type-name referenced by a using-alias-directive.
• Thus, using-namespace-directives in the same compilation unit or namespace body do not affect each
other and can be written in any order.
• Conclusion
• C# programs are organized using namespaces. Using directives are provided to facilitate the use of
namespaces.
• From this article we can understand the need and usage of Namespaces in classes.
• The Namespaces can hold other types also as follows:
Classes, Structures, Interfaces, Enumerations, Delegates. Namespaces are used both as an "internal"
organization system for a program, and as an "external" organization system-a way of presenting
program elements that are exposed to other programs.
SIRYKT
Sharing Knowledge is Learning
For more updates
For more visit our website www.sirykt.blogspot.com

More Related Content

Similar to 1using in c#

Learning from "Effective Scala"
Learning from "Effective Scala"Learning from "Effective Scala"
Learning from "Effective Scala"
Kazuhiro Sera
 
The right way coding for ios app development
The right way coding for ios app developmentThe right way coding for ios app development
The right way coding for ios app development
Ketan Raval
 
Learn c sharp at amc square learning
Learn c sharp at amc square learningLearn c sharp at amc square learning
Learn c sharp at amc square learning
ASIT Education
 
OCP Java (OCPJP) 8 Exam Quick Reference Card
OCP Java (OCPJP) 8 Exam Quick Reference CardOCP Java (OCPJP) 8 Exam Quick Reference Card
OCP Java (OCPJP) 8 Exam Quick Reference Card
Hari kiran G
 
Apex code (Salesforce)
Apex code (Salesforce)Apex code (Salesforce)
Apex code (Salesforce)
Mohammed Safwat Abu Kwaik
 
Net framework
Net frameworkNet framework
Net framework
Abhishek Mukherjee
 
Objective c slide I
Objective c slide IObjective c slide I
Objective c slide I
Diksha Bhargava
 
Learn C# at ASIT
Learn C# at ASITLearn C# at ASIT
Learn C# at ASIT
ASIT
 
Intro to Scala
 Intro to Scala Intro to Scala
Intro to Scala
manaswinimysore
 
(6) c sharp introduction_advanced_features_part_i
(6) c sharp introduction_advanced_features_part_i(6) c sharp introduction_advanced_features_part_i
(6) c sharp introduction_advanced_features_part_i
Nico Ludwig
 
Object Oriented Programming C#
Object Oriented Programming C#Object Oriented Programming C#
Object Oriented Programming C#
Muhammad Younis
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)
Khaled Anaqwa
 
BACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docxBACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docx
wilcockiris
 
The Ring programming language version 1.5.4 book - Part 74 of 185
The Ring programming language version 1.5.4 book - Part 74 of 185The Ring programming language version 1.5.4 book - Part 74 of 185
The Ring programming language version 1.5.4 book - Part 74 of 185
Mahmoud Samir Fayed
 
Active server pages
Active server pagesActive server pages
Active server pagesstudent
 
Variables and User Input
Variables and User InputVariables and User Input
Variables and User Input
primeteacher32
 

Similar to 1using in c# (20)

Learning from "Effective Scala"
Learning from "Effective Scala"Learning from "Effective Scala"
Learning from "Effective Scala"
 
The right way coding for ios app development
The right way coding for ios app developmentThe right way coding for ios app development
The right way coding for ios app development
 
Learn c sharp at amc square learning
Learn c sharp at amc square learningLearn c sharp at amc square learning
Learn c sharp at amc square learning
 
Namespace
NamespaceNamespace
Namespace
 
Javasession6
Javasession6Javasession6
Javasession6
 
OCP Java (OCPJP) 8 Exam Quick Reference Card
OCP Java (OCPJP) 8 Exam Quick Reference CardOCP Java (OCPJP) 8 Exam Quick Reference Card
OCP Java (OCPJP) 8 Exam Quick Reference Card
 
Apex code (Salesforce)
Apex code (Salesforce)Apex code (Salesforce)
Apex code (Salesforce)
 
Net framework
Net frameworkNet framework
Net framework
 
Objective c slide I
Objective c slide IObjective c slide I
Objective c slide I
 
Learn C# at ASIT
Learn C# at ASITLearn C# at ASIT
Learn C# at ASIT
 
Java
JavaJava
Java
 
Intro to Scala
 Intro to Scala Intro to Scala
Intro to Scala
 
(6) c sharp introduction_advanced_features_part_i
(6) c sharp introduction_advanced_features_part_i(6) c sharp introduction_advanced_features_part_i
(6) c sharp introduction_advanced_features_part_i
 
Object Oriented Programming C#
Object Oriented Programming C#Object Oriented Programming C#
Object Oriented Programming C#
 
Packages and interfaces
Packages and interfacesPackages and interfaces
Packages and interfaces
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)
 
BACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docxBACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docx
 
The Ring programming language version 1.5.4 book - Part 74 of 185
The Ring programming language version 1.5.4 book - Part 74 of 185The Ring programming language version 1.5.4 book - Part 74 of 185
The Ring programming language version 1.5.4 book - Part 74 of 185
 
Active server pages
Active server pagesActive server pages
Active server pages
 
Variables and User Input
Variables and User InputVariables and User Input
Variables and User Input
 

More from Sireesh K

Cn10
Cn10Cn10
Cn10
Sireesh K
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
Sireesh K
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
Sireesh K
 
What is mvc
What is mvcWhat is mvc
What is mvc
Sireesh K
 
31c
31c31c
31cs
31cs31cs
31cs
Sireesh K
 
45c
45c45c
44c
44c44c
43c
43c43c
42c
42c42c
41c
41c41c
40c
40c40c
39c
39c39c
38c
38c38c
37c
37c37c
35c
35c35c
34c
34c34c
33c
33c33c
30c
30c30c
29c
29c29c

More from Sireesh K (20)

Cn10
Cn10Cn10
Cn10
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
What is mvc
What is mvcWhat is mvc
What is mvc
 
31c
31c31c
31c
 
31cs
31cs31cs
31cs
 
45c
45c45c
45c
 
44c
44c44c
44c
 
43c
43c43c
43c
 
42c
42c42c
42c
 
41c
41c41c
41c
 
40c
40c40c
40c
 
39c
39c39c
39c
 
38c
38c38c
38c
 
37c
37c37c
37c
 
35c
35c35c
35c
 
34c
34c34c
34c
 
33c
33c33c
33c
 
30c
30c30c
30c
 
29c
29c29c
29c
 

Recently uploaded

The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 

Recently uploaded (20)

The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 

1using in c#

  • 1. C# Tutorial Part 1: Using statement www.sirykt.blogspot.com
  • 2. • The using keyword has two uses: • Create an alias for a namespace (a using alias). • Permit the use of types in a namespace, such that, you do not have to qualify the use of a type in that namespace (a using directive). • Java programmers should note that, we could use namespace first, followed by using or vice versa. • The only purpose of the using command in this context is to save you typing and make your code simpler. • It does not, for example, cause any other code or libraries to be added to your project. • If your code uses base classes, you need to ensure separately that the compiler knows which assemblies to look in for the classes (/r switch in the compiler). • Implement the "using" Directive • Next, we'll write a console application that uses the Hello class. We could just use the fully qualified name for the class-arun.CSharp.Namespaces. • Hello-but this name is quite long and unwieldy. • An easier way is to use a "using" directive, which makes it possible to use all of the types in a namespace without qualification. • If you would like to call methods without typing their fully qualified name, you can implement the "using" directive.
  • 3. • using system; using arun.CSharp.Namespaces; class Hello { • static void Main() { • Hello m = new Hello (); System.Console.WriteLine(m.GetMessage()); • } } • "using System", is the same "using" directive you have seen in every program in this article. It allows you to type the method names of members of the "System" namespace without typing the word "System" every time. • In class Hello(), "Console" is a class member of the "System" namespace with the method "WriteLine". It's fully qualified name is "System.Console.WriteLine(...)". • Note that the two occurrences of Hello are shorthand for arun.CSharp.Namespaces.Hello. C# also enables the definition and use of aliases. • Such aliases can be useful in situation in which name collisions occur between two libraries, or when a small number of types from a much larger namespace are being used.
  • 4. • Using alias directives • A using-alias-directive introduces an identifier that serves as an alias for a namespace or type within the immediately enclosing compilation unit or namespace body. • using identifier = namespace-or-type-name ; • Within member declarations in a compilation unit or namespace body that contains a using-alias- directive, the identifier introduced by the using-alias-directive can be used to reference the given namespace or type. • For example: namespace N1.N2 {class A {} • } namespace N3 {using A = N1.N2.A; class B: A {} • } • Here, within member declarations in the N3 namespace, A is an alias for N1.N2.A, and thus class N3.B derives from class N1.N2.A. The same effect can be obtained by creating an alias R for N1.N2 and then referencing R.A: • namespace N3 {using R = N1.N2; class B: R.A {} • }
  • 5. • The identifier of a using-alias-directive must be unique within the declaration space of the compilation unit or namespace that immediately contains the using-alias-directive. • Using namespace directives • A using-namespace-directive imports the types contained in a namespace into the immediately enclosing compilation unit or namespace body, enabling the identifier of each type to be used without qualification. • using-namespace-directive:using namespace-name ; • Within member declarations in compilation unit or namespace body that contains a using- namespace-directive, the types contained in the given namespace can be referenced directly. • For example: namespace N1.N2 { • class A {} • } namespace N3 { • using N1.N2; class B: A {} • }
  • 6. • Here, within member declarations in the N3 namespace, the type members of N1.N2 are directly available, and thus class N3.B derives from class N1.N2.A. • Like a using-alias-directive, a using-namespace-directive does not contribute any new members to the underlying declaration space of the compilation unit or namespace, but rather affects only the compilation unit or namespace body in which it appears. • The namespace-name referenced by a using-namespace-directive is resolved in the same way as the namespace-or-type-name referenced by a using-alias-directive. • Thus, using-namespace-directives in the same compilation unit or namespace body do not affect each other and can be written in any order. • Conclusion • C# programs are organized using namespaces. Using directives are provided to facilitate the use of namespaces. • From this article we can understand the need and usage of Namespaces in classes. • The Namespaces can hold other types also as follows: Classes, Structures, Interfaces, Enumerations, Delegates. Namespaces are used both as an "internal" organization system for a program, and as an "external" organization system-a way of presenting program elements that are exposed to other programs.
  • 8. For more updates For more visit our website www.sirykt.blogspot.com