Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have sample extends class in java and i wanna do the same in c#

C#
public abstract class CreatureController<T extends Creature> extends VisibleObjectController<Creature>


What I have tried:

I tried this but just can extends Creature class only, im missed extends VisibleObjectController but i dont know how todo it.
C#
public abstract class CreatureController<T> where T : Creature
Posted
Updated 29-Nov-16 5:34am

1 solution

Try this:
C#
public abstract class CreatureController<T> : VisibleObjectController<Creature> where T : Creature
{
    // class code here
}
 
Share this answer
 
v4
Comments
EADever 29-Nov-16 23:25pm    
Your suggestion don't have override function call on base class?
Thomas Daniels 30-Nov-16 9:36am    
I don't see what this line has to do with method overriding. You still have to put your own code between the { and the }.
Thomas Daniels 30-Nov-16 9:46am    
Ehsan Sajjad, thanks for your edit but it was not quite correct: the question specifies deriving from VisibleObjectController<Creature> and not VisibleObjectController<T> so I had to undo it.
EADever 30-Nov-16 9:53am    
This is what I expect... Thanks for your help
Thomas Daniels 30-Nov-16 9:56am    
You're welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900