Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is there anyway to implment an abstract constructor?

 

I.e. how can i acheive the following: -

 

public abstract class MyAbstract

{

public abstract MyAbstract();

}

 

I get the message "The modifier 'abstract' is not valid for this item" which i can understand by i wish to implement 3 overridable, overloading constructors for an abstract class. Can/should i do this? if not what am i not grasping properly?

 

Cheers,

  • *Experts*
Posted

You don't really need abstract on a constructor - it's always overridable (and you never need the word override on the constructor in an inheriting class). It's a special case.

 

-nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted
Apologies I did not put anywhere near enough explanation into that, was the end of the day and i think my mind was elsewhere... I've sorted out what i was trying to achieve now, thanks for the replies!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...