What makes a type different from class and vice versa?
(In the general language-agnostic sense)
Interesting question. I think aku's answer is spot on. Take the java ArrayList
class as an example
public class ArrayList extends AbstractList
implements List, RandomAccess, Cloneable, java.io.Serializable
An instance of the ArrayList
class is said to be of type of every superclass it extends and every interface it implements. Therefore, an instance of the ArrayList
class has a type ArrayList
, RandomAccess
, Cloneable
, and so forth. In other words, values (or instances) belong to one or more types, classes define what these types are.