Solved

property access error in abstract class

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
What is MicroStrategy.NET? 2 47
The Using statement in C# 5 37
asp.net mvc5 3 38
C# Error - Add Failed 12 52
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now