PC Review


Reply
Thread Tools Rate Thread

abstract class

 
 
Peter Morris
Guest
Posts: n/a
 
      18th Jun 2008
> If I have a abstract class with some field what is the best way
> to set these fields. It can't be done by using the constructor
> because an abstract class doesn't have any constructor.


An abstract class may have constructors.



--
Pete
=========================================
I use Enterprise Core Objects (Domain driven design)
http://www.capableobjects.com/
=========================================


 
Reply With Quote
 
 
 
 
Tony
Guest
Posts: n/a
 
      18th Jun 2008
Hello!

If I have a abstract class with some field what is the best way
to set these fields. It can't be done by using the constructor
because an abstract class doesn't have any constructor.


//Tony


 
Reply With Quote
 
GArlington
Guest
Posts: n/a
 
      18th Jun 2008
On Jun 18, 2:47 pm, "Peter Morris" <mrpmorris at gmail dot com> wrote:
> > If I have a abstract class with some field what is the best way
> > to set these fields. It can't be done by using the constructor
> > because an abstract class doesn't have any constructor.

>
> An abstract class may have constructors.

True, but it can not be instantiated.
>
> --
> Pete
> =========================================
> I use Enterprise Core Objects (Domain driven design)http://www.capableobjects.com/
> =========================================


 
Reply With Quote
 
GArlington
Guest
Posts: n/a
 
      18th Jun 2008
On Jun 18, 2:51 pm, "Tony" <johansson.anders...@telia.com> wrote:
> Hello!
>
> If I have a abstract class with some field what is the best way
> to set these fields. It can't be done by using the constructor
> because an abstract class doesn't have any constructor.
>
> //Tony


Instantiate the object that extends this abstract class and init the
value...
 
Reply With Quote
 
Peter Morris
Guest
Posts: n/a
 
      18th Jun 2008
> True, but it can not be instantiated.

That's irrelevant, he wants to set some member values from constructor
parameters not create an instance.


--
Pete
=========================================
I use Enterprise Core Objects (Domain driven design)
http://www.capableobjects.com/
=========================================


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Abstract method in non-abstract class Chris Zopers Microsoft ASP .NET 2 8th Aug 2008 12:40 PM
what is abstract class and abstract method N.RATNAKAR Microsoft C# .NET 4 19th Oct 2006 08:23 PM
Using reflection to get the class name from a virtual method in an abstract class Kevin Grigorenko Microsoft Dot NET Framework 4 28th Mar 2005 08:05 PM
RE: Framework 1.1 bug. Derived class generating Abstract base class stubs. Sometimes. MSFT Microsoft VB .NET 3 4th Nov 2003 06:53 AM
abstract class, implementing virtual class loaded at runtime Robb Sadler Microsoft C# .NET 2 11th Oct 2003 03:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:25 PM.