Namespace and Virtual method in c#

NameSpace

NameSpace is the Logical group of types or we can say namespace is a container (e.g Class, Structures, Interfaces, Enumerations etc.).

Example: a) System.IO logically groups input output related features.

b) System.Data.SqlClient is the logical group of ado.net Connectivity with Sql server related features. In Object Oriented world, many times it is possible that programmers will use the same class name, Qualifying NameSpace with class name can avoid this collision.

virtual method
A virtual method can be redefined. The virtual keyword designates a method that is overridden in derived classes.
A virtual method is created in the base class that can be overriden in the derived class.
Override Method
The override modifier is needed for implementing polymorphic behaviors in derived classes. You can re-implement a virtual base method. This causes the base implementation to be ignored in favor of the override method.

Abstract Class
Abstract classes, marked by the keyword abstract in the class definition, are typically used to define a base class in the hierarchy. What’s special about them, is that you can’t create an instance of them – if you try, you will get a compile error.

Abstract method
An abstract method has no implementation. Its implementation logic is provided instead by classes that derive from it. We use an abstract class to create a base template for derived classes.

Share

7 thoughts on “Namespace and Virtual method in c#”

  1. Hi there, I read your blogs regularly. Your story-telling
    style is awesome, keep doing what you’re doing!

  2. Hey there, You’ve done a great job. I will definitely digg it and personally suggest to my friends.
    I’m confident they will be benefited from this site.

  3. I do not even know how I ended up here, but
    I thought this post was good. I don’t know who you are but
    definitely you are going to a famous blogger if you are not already 😉 Cheers!

  4. Great site. Lots of useful information here. I’m sending it
    to several buddies ans also sharing in delicious. And naturally, thank you on your sweat!

  5. Its like you learn my thoughts! You appear to understand so much about this, such as you wrote the e book inside it or something.
    I feel which you can do with a couple of percent to pressure your message home a bit, but rather than that, that may be excellent blog.
    An incredible read. I’ll definitely be back.

  6. Its as if you read my mind! You appear to understand a
    good deal about this, such as you wrote the book in it or anything.
    I feel that you just can use some p.c. to power your message home a little bit,but apart from that, which is fantastic blog. An outstanding read.
    I’ll certainly come back.

  7. Nice post. I found myself checking constantly this weblog and I’m inspired! Very useful info particularly the ultimate section 🙂 I take care of such info much. I found myself seeking this particular information for the very lengthy time.Thanks and best of luck.

Comments are closed.

Share
Scroll to Top