Tuesday, June 28, 2011

Namespaces (C# Programming)

Namespaces have the following properties:
  • They organize large code projects.
  • They are delimited by using the . operator.
  • The using directive obviates the requirement to specify the name of the namespace for every class.
  • The global namespace is the "root" namespace: global::System will always refer to the .NET Framework namespace System.

    namespace SampleNamespace
    {
        class SampleClass
        {
            public void SampleMethod()
            {
                System.Console.WriteLine(
                  "SampleMethod inside SampleNamespace");
            }
        }
    }
     
     
     

No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

What is Zorin OS? Zorin OS is a powerful, secure, and unbelievably beautiful Linux distribution based on Ubuntu. It's specifically designed to make your switch from Windows or macOS buttery smooth! 🧈

  I'm diving into the world of Linux with Zorin OS! 🤯 In this video, I'll be installing and exploring this stunning operating syste...