Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
Which one will take more memory, an int or Integer?
Home
JAVA
Which one will take more memory, an int or Integer?
+1
vote
asked
Jan 24, 2020
in
JAVA
by
rahuljain1
Which one will take more memory, an int or Integer?
#java-memory
Java-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jan 24, 2020
by
SakshiSharma
An Integer object will take more memory an Integer is the an object and it store meta data overhead about the object and int is primitive type so its takes less space.
Your comment on this answer:
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Related questions
+1
vote
Q: Can we cast an int value into byte variable? what will happen if the value of int is larger than byte?
asked
Jan 24, 2020
in
JAVA
by
rahuljain1
#java-variable
Java-questions-answers
0
votes
Q: The range of INTEGER or INT data type is _____________.
asked
Apr 17, 2022
in
Apache Drill
by
sharadyadav1986
integer-range
+1
vote
Q: What is the size of an int variable in 32-bit and 64-bit JVM?
asked
Jan 24, 2020
in
JAVA
by
rahuljain1
#jvm-size
Java-questions-answers
+1
vote
Q: Can we have more than one package statement in source file ?
asked
Jun 17, 2019
in
JAVA
by
reins.robin
#java
#java-script
#java-question
#java-interview-question
Java-questions-answers
0
votes
Q: What are the similarities and differences between Scala’s Int and Java’s java.lang.Integer? What is the relationship between Int and RichInt in Scala?
asked
Sep 12, 2022
in
Scala Constructs
by
Robin
scala
java
0
votes
Q: How to convert string to integer in java?
asked
Oct 20, 2020
in
JAVA
by
sharadyadav1986
#string-to-integer
#integer-in-java
Java-questions-answers
0
votes
Q: how to convert integer to string in java?
asked
Oct 18, 2020
in
JAVA
by
sharadyadav1986
#convert-integer-to-string
#integer-to-string-java
#string-in-java
Java-questions-answers
0
votes
Q: The Swipe event is triggered when a horizontal drag of _________ px or more occurs.
asked
Feb 7, 2020
in
JAVA
by
rajeshsharma
#jquery-swift-event
Java-questions-answers
0
votes
Q: How to convert double to int in java?
asked
Oct 20, 2020
in
JAVA
by
sharadyadav1986
#convert-double-to-int
#double-to-int
Java-questions-answers
0
votes
Q: How to convert char to int in java?
asked
Oct 18, 2020
in
JAVA
by
sharadyadav1986
#convert-char-to-int
#char-to-int
#int-in-java
Java-questions-answers
...