Object-orientation

2019-02-02  本文已影响0人  津涵

Three most important concepts

inheritance继承
encapsulation封装
polymorphism多态

This means that a C# class can be derived from one other class, and any number of interfaces

Differnences between structs (value types) and classes (reference types)

1)Structs are always derived from System.ValueType. They can also implement any number of interfaces.
2)Classes are always derived from either System.Object or a class that you choose. They can also implement any number of interfaces.

上一篇 下一篇

猜你喜欢

热点阅读