Why namespace is used in .net




















MyMethod is a method of class MyClass. The members of a namespace can be accessed using the dot. The syntax for accessing the member of namespace is,. We will discuss about creating objects in later tutorials. For now just focus on how the class MyClass is accessed. In the above program, we have created our own namespace MyNamespace and accessed its members from Main method inside MyClass.

As said earlier, the dot. In the Main method, myMethod method is called using the dot. The advantage of this approach is we don't have to specify the fully qualified name of the members of that namespace every time we are accessing it.

A namespace can contain another namespace. It is called nested namespace. The nested namespace and its members can also be accessed using the dot. Here, we now have an extra namespace inside MyNamespace called Nested. So, instead of using MyNamespace. Course Index Explore Programiz. Start Learning C. Operators in C. C if Statement. C foreach Loop. C for Loop. Explore Python Examples. Here i have removed Using keyword in all Namespaces.

Mathematical computations. Random Number generation Garbage collection Intrinsic data Exceptions and attributes. Subscribe through email and get Free updates in inbox. Please like and share this post with your friends Newer Post Older Post Home. Mail us on [email protected] , to get more information about given services. Please mail your requirement at [email protected] Duration: 1 week to 2 week.

Net C ADO. C Inheritance C Aggregation. C Abstract C Interface. WriteLine "Hello Namespace! Hello ; Second. Hello ; h1. Next Topic C Access Modifiers. Reinforcement Learning. R Programming. React Native. Python Design Patterns. Python Pillow. Python Turtle. Verbal Ability. Interview Questions.



0コメント

  • 1000 / 1000