mardi 25 décembre 2018

What is the difference between the class `Class` and the class `Type` in java?

I've read this SO question that talks about the difference between classes and types in java

However, this talks about classes declared with the class keyword rather than the actual class Class in java. In Java, I can have a Class<T> where T is a class/interface/array type (and for primitives, T would be the autoboxed class, but the instance of Class<T> would be associated with the primitive type, such as int.class). Point is, Class is used with more than just class types.

What is the difference between the classClass and interface Type?





Aucun commentaire:

Enregistrer un commentaire