Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between class and abstract class?

Answer Posted / radix

class is a container for methods, and i can access those
methods by creating the object of my class, and then using
the dot operator with my object to access those methods.
example: radix obj = new radix();
[where class name is radix, obj is the object of my class
radix]
now assume that my class contains a method to add two
integer values and the name of that method is add(), i can
access add by telling the compiler
example: obj.add();

but sometimes a situation comes where i do not want to
create an object of my class, their i can use the abstract
keyword
this is because the methods of my base class can be
accessed by my derived class by using : in c# so their is
no use of creating the object of the base class because by
default every method can be acessed of the base class so
instead of creating object of the base class i can create
the object of my derived class and can access function of
my base class...

if u still have confusion try this code out

using System;
abstract class Radix
{
public void fun()
{
Console.WriteLine("hello dude");
}

}
class me:Radix // inheriting base class radix
{
void funt()
{

Console.WriteLine("hi, dude");
}
static void Main()
{

me obj = new me(); //derived class object
obj.fun();//accessing base class method
obj.funt();
Console.Read();
}

}

i hope this exaqmple helps for further help contact me on
my mail id
mailme.rsharp@rediffmail.com
Thanks and Regards,
Radix.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is yield c#?

823


Is c# static or dynamic?

903


What is IL / CIL / MSIL?

1068


Can you have more than one namespace in c#?

889


Will the following code compile?

916


How do I start a program in c#?

938


What is unmannaged code and will CLR handle this kind of code or not .

975


What is sqladapter c#?

908


how to compare numbers and dispaly the largest ? *first thing I wanted to do is to input how many numbers to be compared *and then analyzed the largest then display it.

1675


How to use delegates with events?

958


What happens if you add duplicate elements to a set?

842


What is the difference between delegates and events in c#?

926


What are the Types of optimization and name a few and how do u do?

955


What can you do as a .net developer?

892


What are object pooling and connection pooling and difference? Where do we set the Min and Max Pool size for connection pooling?

1089