Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between Integer and int?

Answer Posted / devendra

An int is a primitive. It is not an Object.int variables
are mutable. Unless you mark them final, you can change
their value at any time.
An Integer, is a Object that contains a single int
field.Integers are immutable. If you want to affect the
value of a Integer variable, the only way is to create a
new Integer object and discard the old one.

Converting
// to int i from Integer ii
int i = ii.intValue();

// to Integer ii from int i
Integer ii = new Integer( i );

Is This Answer Correct ?    27 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you check if a string is lexicographically in java?

910


What is skeleton and stub?

994


What is the difference between notify and notifyall method?

1122


What is a marker interface?

1095


Can we use synchronized block for primitives?

1017


What are the main concepts of oops in java?

1629


What is the difference between static (class) method and instance method?

1036


Which is illegal identifier in java?

1026


Which list does not allow duplicates in java?

878


What is the difference between super class & sub class?

1096


What is the difference between yielding and sleeping in java programming?

1085


Differentiate between postfix and prefix operators in java.

1085


Does java trim remove newline?

930


Can we overload final method in java?

940


Why main function is static?

1154