• Post Reply Bookmark Topic Watch Topic
  • New Topic

difference between Integer and BigInteger  RSS feed

 
kushwanth
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All
I have a doubt please clarify this
what are the major differences between primitive int,java.lang.Integer,java.math.BigInteger

and How can i make use of BigInteger class

thanks all in advance
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"kushwanth" (previously "prutvi raj"),

You've been warned before about your display name, which does not meet the JavaRanch Naming Policy. You can edit your display name here. Thank you for your prompt attention!

With respect to your question, have you checked the API documentation?
[ December 16, 2007: Message edited by: marc weber ]
 
Phani Burra
Ranch Hand
Posts: 52
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Integer is a wrapper of the primitive type int.The wrapper classes are basically used in cases where you want to treat the primitive as an object for ex-trying to pass an int value in a method that would take only a type of Object in such a case you would want to wrap primitive int value in the wrapper Integer which is of type Object. To know specific advantages of Integer I would suggest you to take a look at the Integer api provided by Sun.

Now coming to the BigInteger, you would use it in calculations which deal with very large numbers.The use of BigIntegers is in Security where typically it is used for keys specifications.For more info on BigIntegers take a look at the following link http://java.sun.com/j2se/1.4.2/docs/api/java/math/class-use/BigInteger.html

I hope the info helped you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!