What is the difference between class and abstract class?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
What is the difference between class and namespace?
Explain clr in brief.
Write a program to find the angle between the hours and minutes in a clock
How do I run managed code in a process?
In which way a two-dimensional array declared in C#?
How do you generate documentation from the C# file commented properly with a command-line compiler?
Does c# have functions?
Explain types of comment in c# with examples
Explain the term inheritance in C#.
0 Answers Deloitte, JPMorgan Chase,
hi In my database i put id column as identity(the database is incremented by it self only)what i want is if i enter a data in my website, id will come automatically can u pl z tell me the code thax in advance
what is collections and what is generics
what is the Difference between the public and private ?