Amandeep Singh wrote:will they loose precision after the limited range. so how much is the limited range?
If you try to assign a value to a primitive type that is out of its range the JVM will yell at you. You can't assign a value to a primitive that is outside of its range unless you explicitly cast it to the desired type, but it will result in loss of precision.
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."
If you add an int to an int, and the resulting value would become larger than Integer.MAX_VALUE, it will wrap - becoming negative. If you believe this is a possibility, use long. If the same issue can occur for long (becoming larger than Long.MAX_VALUE), BigInteger and BigDecimal are the only options.
Joined: Jul 17, 2008
Well i will go with BigDecimal. Integer.Max_value has a limit of 2147483647.