what-is-the-difference-between-type-and-class

Inspired by Wikipedia...

In type theory terms;

  • A type is an abstract interface.
    Types generally represent nouns, such as a person, place or thing, or something nominalized,
  • A class represents an implementation of the type.
    It is a concrete data structure and collection of subroutines
    Different concrete classes can produce objects of the same abstract type (depending on type system).

An object can have many types, and objects of different classes can have the same type.

https://stackoverflow.com/questions/468145/what-is-the-difference-between-type-and-class

猜你喜欢

转载自www.cnblogs.com/feng9exe/p/10981524.html