Click here to Skip to main content
       

ASP.NET

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
Questionasp.netmemberNitin Pant20-Dec-12 21:43 
sir,
 
difference between a normal class and abstract class?
AnswerRe: asp.netmvpRichard MacCutchan20-Dec-12 22:57 
You could type that question into Google and get all the information you need.
One of these days I'm going to think of a really clever signature.

RantRe: asp.netmemberRichard Deeming21-Dec-12 1:31 
Why bother doing that when you can get someone else to type it in, look through the links, find a suitable one and post it here? Particularly when that person is then required to answer any questions you might have about the link they've posted.
 
We're nothing more than a free Mechanical Turk[^] for Google. Sigh | :sigh:



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: asp.netmvpRichard MacCutchan21-Dec-12 2:04 
Too true. Frown | :(
One of these days I'm going to think of a really clever signature.

JokeRe: asp.netmembern.podbielski22-Dec-12 21:54 
Then just use links to that page: http://lmgtfy.com/[^]
You provide the link they use it and in the end google what they want. Everyone is happy Smile | :)
No more Mister Nice Guy... >: |

AnswerRe: asp.netmemberJ4amieC20-Dec-12 23:26 
What an imaginative title, in an asp.net forum. Its just a shame your question has nothing whatsoever to do with asp.net D'Oh! | :doh:
 
In answer to your question, an abstract class cannot be instantiated.
AnswerRe: asp.netmemberProgramFOX20-Dec-12 23:52 
Hi,
 
Have a look here:
Abstract and Sealed Classes and Class Members (C# Programming Guide)[^]
But what has this question to do with ASP.NET?
In some cases, my signature will be longer then my message...
ProgramFOX

AnswerRe: asp.netmemberCommDev23-Dec-12 14:15 
Hi,
An abstract class is a class that contains a pure virtual method or function(inc c++). In C#, you do not need a pure virtual method to make a class abstract, just the keyword. Essentially when you make a class abstract, you are saying that you do not want any specific instances of it made, but the class can be used for inheritance. C# only supports single class inheritance. Also, with an abstract class it can contain other non pure virtual methods that provide functionality. For example, I can make an abstract class named Shape with a property to get and set the name and implement an abstract method to return the number of vertexes for that shape. I can't make a shape object, but I can inherit from it to make a square. I do not need to implement the name method because it is already defined, but I do need to implement the vertexes one because it is a pure virtual method.
Interfaces can be thought of as an abstract class that only contains pure virtual methods; however, in C# you can implement multiple interfaces to produce certain behaviors. You still need to implement all of the pure virtual methods, but you can use an interface and another class to represent a different "is-a" relationship.
 
Thanks,
CommDev
Live Support Software for Business Smile | :)

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web01 | 2.6.130617.1 | Last Updated 19 Jun 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid