What is the difference between Integer and int?

Answer Posted / janet

Integer is a class defined in the java.lang package,where
as int is a primitive data tyep defined in the java
language itself.Java doesn't automatically convert from one
to the other.
Integer can be used as an argument for a method that
requires an object,where as int can be used for
calculations.

Is This Answer Correct ?    59 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you break a loop?

563


Does importing a package imports its sub-packages as well in java?

552


What all methods are used to prevent thread execution ?

554


Explain inheritance in java?

553


Can you instantiate the math class?

600






What is fail first in java?

567


Discuss about garbage collector in Java.

640


explain multi-threading in java?

555


What are the restrictions that are applied to the java static methods?

527


What is difference between fileinputstream and filereader in java?

557


What do you understand by the term wrapper classes?

542


Can a class be declared as static?

676


What is boolean in java?

509


What is a parameter in java?

546


What is t in generics in java?

561