Alex Rivera | Logout

'Extends' and 'Implements' Java equivalents in C#

Asked 2013-01-25T08:11:43.960
68

What is the C# equivalent syntax for the following Java statement:

public class Lion extends Animal implements Diurnal()
{
}
Edit
Report

1 Answer

16

Would look something like this:

public class Lion :Animal, Diurnal {
}

Where Animal is a class and Diurnal is an interface.

Please note, that according to the C# naming convention, interface has to have "I" infront of its name, so finally it should look like this:

public class Lion :Animal, IDiurnal {
}
answered 2013-01-25T08:13:06.500

Your Answer