interface with generics 1. Definition of interface: Access modifier Interface Interface Name {Member}2. The interface is an abstract of the year, with the aim of subclasses implementing it 3. Interfaces are typically used to define a uniform standard between different classes 4. Interface members: Including methods, properties, events, indexes, Cannot have field 5. Interface members cannot have modifiers, default is public and require implementation class (subclass) to implement all interface members in the interface 6. Interfaces and abstract classes are abstract concepts, so objects cannot be created (not new) 7. If a class implements multiple interfaces, the interface is separated by a comma "," 8 If a class inherits one parent class at a time and implements one or more interfaces, the parent class is placed at the front of the generic method: public void Method Name < type > () {} generic class:test<int> A = new test<int> (); Constraints for generic parameters: public class Test<t>where T:struct {} can only be of value type: public class Test<t>where T:class {} can only be of reference type
C # Notes (14)--Interface generics