What is the difference between class and abstract class?

Answers were Sorted based on User's Feedback



What is the difference between class and abstract class?..

Answer / chandra kiran

we are unable to create a object for abstract classes
so it is used only as a base class for inheritance

Is This Answer Correct ?    5 Yes 0 No

What is the difference between class and abstract class?..

Answer / srinivas dumpeti

Class is a set of objects and instances
where as abstract class in that their is no declaration,and
that can be inherit to dervied class that is known as
concrete methods..

Is This Answer Correct ?    4 Yes 0 No

What is the difference between class and abstract class?..

Answer / sravanthi

A class is a template that defines the form of all
objects.where as abstract class provides a contract between
service providers and its clients.an abstract class can
provide implementation.

Is This Answer Correct ?    2 Yes 0 No

What is the difference between class and abstract class?..

Answer / chandra kiran

we are unable to create a object for abstract class. This is only used as a base class for inheritance

Is This Answer Correct ?    1 Yes 0 No

What is the difference between class and abstract class?..

Answer / naresh kumar

A class can create 'n' number of objects, but the abstract
class cannot.the abstract class inherits with base class to
use an object.
Examples:Topics Inheritance and interfaces

Is This Answer Correct ?    1 Yes 0 No

What is the difference between class and abstract class?..

Answer / ajit singh

1>A Class is a collection of objects,we can create the object of a class but in case of abstract class we unable to carete the object and no decleration.
2> class can contain method and definations,abstract class having all methods abstract

Is This Answer Correct ?    1 Yes 0 No

What is the difference between class and abstract class?..

Answer / vijay kumar

Class can create 'n' numbers of objects but abstract class
can only create reference object.and bydefault scope of the
abstract class is public while simple class bydefault internal.

Is This Answer Correct ?    1 Yes 1 No

What is the difference between class and abstract class?..

Answer / 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

What is the difference between class and abstract class?..

Answer / kanan

Following are some differences.
1) You can not create object of an abstract class.
2) When you inherits abstract class , than you have to
implement (override) its abstract methods.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Why do we use static class in c#?

0 Answers  


What are satellite assemblies?

0 Answers  


How to find Percentage, name ,College from a resume or document ? How to export these values to other page in C#?

0 Answers   CDC,


What is a Command Object in C#?

0 Answers   B-Ways TecnoSoft,


Does C# support multiple inheritance?

3 Answers   IBM, Siebel Systems, Visual Soft,






What is expandoobject in c#?

0 Answers  


Is string mutable in c#?

0 Answers  


Is cli same as the clr?

0 Answers  


What is serialization and deserialization in c# with example?

0 Answers  


Explain the difference between .net and c#?

0 Answers  


What are extender provider components?

0 Answers  


Can a loop recorder detect a heart attack?

0 Answers  


Categories