C#: Learn C# FAST! The Ultimate Course Book (Beginners to Advanced) by Gary Mitnick

C#: Learn C# FAST! The Ultimate Course Book (Beginners to Advanced) by Gary Mitnick

Author:Gary Mitnick
Language: eng
Format: azw3, epub
Published: 2017-05-04T07:00:00+00:00


If there is any difference between the interface definition and its declared implementation, the class will not compile.

It is possible for a class to inherit from another class and implement an interface simultaneously. To do this C# uses a positional notation: i.e. initially its the base class followed by a comma and fially the interface. The following example defines Alligator as a class that is a Reptile but that additionally implements the IWaterBased interface:

class Reptile

{

. . .

}

class Alligator : Reptile, IWaterBased

{

public int NumberOfLegs()

{

return 4;

}

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.