Thread
#feed
    c

    cedric

    4 years ago
    @Marcin This is incorrect:
    The Box is a class, while Box<Int>, Box<A>, Box<List<String>> are types generated by generic class Box
    Box
    is not a class, it's a type constructor.
    Box<Int>
    is a class. Also, types are usually the global name used to denote a structure, e.g. an interface, a class, a trait, etc... I feel you made up your own meaning for these terms in the sentence i quoted.
    voddan

    voddan

    4 years ago
    @cedric are you sure that
    Box<Int>
    is a class? In C++ I would totally agree with you (
    Box<T>
    is a template there), but on JVM a class is something that has a class object (that thing that contains static fields and the method table), so
    Box
    must be a class, and
    Box<Int>
    is a compile-time type on top of that class
    It is coincidence that there is also
    Box
    xD
    Box
    to generic class, and
    Box<Integer>
    is generic type.
    I don't know how it is defined in C++. Terms and definitions comes from category theory, but there are some different nomenclatures in different languages. For JVM I am quite sure that it is correct while it is hard to argue with Java docs.
    voddan

    voddan

    4 years ago
    it is correct
    Which point of view do you support?
    marcinmoskala

    marcinmoskala

    4 years ago
    @voddan I meant my article, but I think that your answer is also correct