1. Static members are accessed directly.
2. Static can be accessed without instantiation.
3. Static functions can only access static members.
4. Static constructors have no arguments and no access modifiers.
4. Static class equivalent to sealed/
5. Static classes can only define static members or constants.
6. Static classes are used for extensions. Just like your own method.
7. Extension method The first parameter of the This+ class name.
8. Boxing and unpacking the box to the hidden turn.
9. Unboxing instances
int i = 3;
Object Oi = i;
int j = (int) Oi;
Print (j);
int i = 3;
Object Oi = i;
Packing.
11. Custom conversions to your own structure or class definition display or implicit conversions are custom transformations.
12. Implicit conversion syntax public static implicit operator Dog (cat cat);
13. It is the cat that converts the puppy.
15. Show conversion is public static explicit operator Dog (cat cat);
Public static implicit operator Cat (dog dog) {
return new Cat (Dog._name);
}
17. If the class is the dog method is the cat's
As follows
public static implicit operator Cat (dog dog) {
return new Cat (Dog._name);
}
C # Object-oriented 3