I'm starting to learn Java and i've got a question.
Primitive data types are created as any objects in Java? I mean, somewhere in a deep, there is a class which is called Int. Generics are the templates kind of like for creating new data types, right? In terms of convention, we have to put them in angle brackets, like <HugeInteger>
.
Primitive types (like int, double, float) are not Objects. They are primitives and can sometimes be quite annoying and cannot be used as Generics.
For generics you need Objects. That would be Integer, Double, Float and the like.
By the way, there is no class called Int (with an upper case i) unless you declared it.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments