What is the difference between these two? A primitive type cannot have “Class”, can it – it is primitive. There are no objects to have a class.
Where does these two make a difference?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not positive what you mean, but — A
Classobject is a runtime representative of a type. That said, there is such a thing asint.classthat is distinct fromInteger.class, even thoughintis not a class. It’s kind of complicated, but it’s necessary to make reflection work even on methods that take primitive arguments or return primitive values, or to distinguish a method that accepts anIntegerfrom a method that accepts anint.Integer.TYPE, I believe, is equivalent toint.class.