+ 1

Can anyone explain me which one will take more memory int or Integer and why?

15th Dec 2019, 6:22 AM
Vijay Shyam Sharma
Vijay Shyam Sharma - avatar
2 Answers
+ 2
In Java, int is a primitive data type while Integer is a Wrapper class. We cant compare both on the basis of memory still integer will consume more as non static method consumes more.
15th Dec 2019, 6:30 AM
Ujjwal Sinha
Ujjwal Sinha - avatar