Link to home
Start Free TrialLog in
Avatar of 1990mayurpatel
1990mayurpatel

asked on

Is the following class declaration valid?

public abstract class BaseItem<TType,TKeyType> : BaseItem

where TType : BaseItem <TType,TKeyType>

Thank you
ASKER CERTIFIED SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 1990mayurpatel
1990mayurpatel

ASKER

I'm assuming so though it doesn't display the output. On your end if you try to include the code I pasted for the question, does it display an error or does it output something? Thank you for taking the time to write the code by the way.
My displaying the output has nothing to do with the class declaration.  I displayed output to show that the child object accesses the properties as defined in the base object.

Perhaps I should ask what your end goal is?  What are your specification needs?

-saige-
Basically the question I was given was set out like this:

Is the following class declaration valid?

public abstract class BaseItem <TType,TKeyType> : BaseItem

where TType : BaseItem <TType,TKeyType>

Open in new window


There is no output of anything. I think it just wants to know if valid.
When you say things like, "the question I was given...", it makes it sound like a school exam. We are not allowed to give you specific answer to school exams. Is that what this is?
It is for university but it is a mock quiz. I have figured it out by the way.