File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the difference between java.lang.Integer and Integer.Type

 
O. Ziggy
Ranch Hand
Posts: 430
Android Debian VI Editor
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying to figure out the return type as a result of the following use of List.toLower() methods.



The output of the above is:

Type is java.lang.Integer - java.lang.Integer
Type is Integer.Type - false


What exactly is the difference? Is Integer.Type not just the type of java.lang.Integer?

Thanks in advance.

 
Stephan van Hulst
Bartender
Pie
Posts: 4846
34
Chrome Netbeans IDE Windows
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Integer.Type is the type of int, if you read the documentation carefully. int is not the same type as Integer.
 
Ganesan Ponnusamy
MyExamCloud Support
Ranch Hand
Posts: 264
5
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setTimes.lower(1605)).getClass() return class representation of primitive Integer object (return java.lang.Integer).
Integer.TYPE - The Class instance representing the primitive type int (return int).

You may try this system.out.

System.out.println("" + (Integer.TYPE)); // print int
System.out.println(""+(setTimes.lower(1605)).getClass()); // return java.lang.Integer

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic