Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • Last Modified:

property access error in abstract class

How can you immplement constructor in abstract class ?

abstract public myClass(string myParm);

gives me an error.

0
psokolo
Asked:
psokolo
  • 3
1 Solution
 
NightmanCTOCommented:
public myClass (string myParam)
0
 
psokoloAuthor Commented:
but I would like each class to implement a different constructor.
0
 
NightmanCTOCommented:
You could overload it:

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

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now