Results 1 to 5 of 5

Thread: Namespaces in C#

  1. #1
    Join Date
    Dec 2010
    Posts
    66

    Namespaces in C#

    Hello my friends I am an IT students and I am on the track to learn C# programming language and I have got a project in the upcoming year, however I am facing a bit of difficulty in doing it , although it is not being taught yet , I will have C# in my upcoming semester , but I am doing a certification course of .NET framework , so I just wanted to brush a bit of my C# knowledge , like there is a pre- processor directive in the Java language I wanted to know what is there the C# language . When we are using some sort of function for writing or printing anything it makes uses of a namespace , It will be more helpful if a programmer does comment on this because or it will be more beneficial if an experience developer comments on this post. I am awaiting for the response.

  2. #2
    Join Date
    May 2009
    Posts
    529

    Re: Namespaces in C#

    There are lot of namespaces being used bring in you to C# Namespaces. In this article, my objectives are as follows:
    Namespaces permit you to generate a system to manage your code. A good manner to manage your namespaces is via a hierarchical system. You apply the more common names at the peak of the hierarchy and get more definite as you come down. This hierarchical system can be characterized by nested namespaces. By putting code in dissimilar sub-namespaces, you can keep your code structured.

  3. #3
    Join Date
    May 2009
    Posts
    539

    Re: Namespaces in C#

    putting code in dissimilar sub-namespaces, you can keep your code structured.
    The using keyword has normally two fundamental two uses:
    • Create an alias for a namespace (a using alias).
    • You can make the use of different types of the name spaces , such that, you need not require to mention the use of a type in that namespace , for example using system.
    • For example you are tying a method to print any line such as Console.Writeline in your program then you will have to mention using namespace in the beginning of the program. If you do not mention it in the namsepace you will have to write the method as system.Console.Writeline.

  4. #4
    Join Date
    Apr 2009
    Posts
    488

    Re: Namespaces in C#

    Java developers should notice that, we could utilize namespace first, followed by using or vice versa. The only reason of the using command in this circumstance is to keep you typing and make your program simpler. It does not, for instance, result in any other code or libraries to be adjoin to your project. If your code utilizes parent classes, you require to make sure independently that the compiler is aware of which assemblies to search in for the classes .

  5. #5
    Join Date
    May 2009
    Posts
    527

    Re: Namespaces in C#

    Code:
    using system;
    using example.CSharp.Namespaces;
    class Myclass
    {
    static void Main()
    {
    Myclass  c = new Myclass ();
    System.Console.WriteLine(c.GetMessage());
    }
    }
    As said in the above post , here system is the namespace being used in the class but it is appended with the Writeline method, if we do not do it then also it will work as we can see that we have mentioned in our program the system namespace. If you do not understand the program you can post back your question again ,I will repeat my instructions.

Similar Threads

  1. How to use namespaces : fallback to global function in PHP?
    By Nathen in forum Software Development
    Replies: 3
    Last Post: 21-02-2010, 05:05 AM
  2. How to use namespaces : Aliasing/Importing?
    By Bigga Lexx in forum Software Development
    Replies: 4
    Last Post: 21-02-2010, 04:05 AM
  3. How to Define Namespaces in PHP?
    By SKREECH in forum Software Development
    Replies: 5
    Last Post: 21-02-2010, 02:00 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,016,603.44910 seconds with 17 queries