Difference between revisions of "OOP Class6"
(→Interfaces) |
|||
Line 1: | Line 1: | ||
+ | ==UML== | ||
+ | [http://www.gnome.org/projects/dia/ Dia A Drawing Program] | ||
+ | |||
+ | [http://dia-installer.sourceforge.net/ Dia for windows] | ||
+ | |||
+ | |||
==Interfaces== | ==Interfaces== | ||
Revision as of 16:31, 27 February 2006
UML
Interfaces
Interfaces - implements or derives from
An interface is a class that lacks implementation. The only thing it contains are definitions of events, indexers, methods and/or properties. The reason interfaces only provide definitions is because they are inherited by classes and structs, which must provide an implementation for each interface member defined. Since classes in c# can only be derived from one other class ( in c++ it is possible to derive from many) interfaces are used for multiple inheritance. Like abstract classes you cannot create an instance of an interface on derive from it.
/infod/jeff/classSource/class5/interface.cs -source /infod/jeff/classSource/class5/interface2.cs -source Phone interface example phoneIFace.cs -source Multiple interface inheritance - inherits IPhone, Cell, POTS /infod/jeff/classSource/class5/phoneIFacePOTS.cs -source