What is the difference between Type and Class?

前端 未结 20 2366
梦谈多话
梦谈多话 2020-11-28 01:00

What makes a type different from class and vice versa?

(In the general language-agnostic sense)

20条回答
  •  猫巷女王i
    2020-11-28 01:18

    In general language-agnostic sense - Class is an realization of the Type.

    Often when this is the only realization of that type, you can use both terms to reference it in some context.

    On the contrary, for example, in C# context - Class is just one of the many more implementations of a Type concept like primitives, structs, pointers etc.

提交回复
热议问题