Solved

property access error in abstract class

Posted on 2006-12-01
4
278 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
  • 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

Title # Comments Views Activity
Sent email using Shared Mailbox from outlook in C# 5 50
Cant save 3D 4 23
Release Dynamically Allocated Memory in C# 3 38
bound data table problem 2 33
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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 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