What is the difference between Type and Class?

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

What makes a type different from class and vice versa?

(In the general language-agnostic sense)

20条回答
  •  无人及你
    2020-11-28 01:32

    Obviously, as there are languages with type system that are not OO programming languages, type must be a broader concept than class

    Even in languages like Java, int is a (primitive) type, but not a class.

    Hence: every class is a type, but not every type is a class.

提交回复
热议问题