Monday 15 July 2013

How to implement java Overriding on Instantiation in C#? -



How to implement java Overriding on Instantiation in C#? -

i translating sample android application java c# , i'm stuck on piece of code.

commandqueued mconferencequeue = new commandqueued( "conferencemanager" ) { protected void onhandlecommandmessage( message msg ) { onconferenceevent( msg ); } };

after couple of research, seem java allow overriding of class methods @ instantiation.

can tell me how translated in c# ?

you can

public class commandqueued { protected virtual void onhandlecommandmessage(message msg) { //onconferenceevent(msg); } } public class derivedcommandqueue : commandqueued { protected override void onhandlecommandmessage(message msg) { //.. } }

java c# overriding

No comments:

Post a Comment