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

What is the size of arraylist in java?

600


What are the string methods in java?

573


What is the use of inner class?

534


Can we sort a map in java?

570


What are wrapped classes in java programming?

574






How can we make a class singleton?

570


what is the final keyword denotes in java?

573


Explain about abstract classes in java?

574


What is difference between == equals () and compareto () method?

519


Can we change the scope of the overridden method in the subclass?

833


Is java platform independent?

559


What is difference between call by value and call by reference?

493


What is this keyword used for?

678


What is a percentage sign called?

611


What is a variable declaration?

515