Solved

property access error in abstract class

Posted on 2006-12-01
4
280 Views
Last Modified: 2010-04-16
How can you immplement constructor in abstract class ?

abstract public myClass(string myParm);

gives me an error.

0
Comment
Question by:psokolo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 29

Expert Comment

by:Nightman
ID: 18054599
public myClass (string myParam)
0
 

Author Comment

by:psokolo
ID: 18054686
but I would like each class to implement a different constructor.
0
 
LVL 29

Accepted Solution

by:
Nightman earned 250 total points
ID: 18055047
You could overload it:

abstract class myClass
{
  public myClass(string myParam)
  {
  }
}

class myDerivedClass: myClass
{
  public myDerivedClass (string myParam,int myInt):base(myParam)
  {
  }
}
0
 
LVL 29

Expert Comment

by:Nightman
ID: 18055059
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question