Integral Quantity Data types:
Project description:
To represent numbers that dont have a fractional part, we use the int data type in Java i.e. if we declare a variable: int x; then we can only store numbers which dont have a fractional (decimal) part in x. But unlike, the mathematical concept of integer numbers, the Java data type int, imposes limits, a maximum and minimum value for the integer values it can represent in a program.
1. Look up the maximum and minimum values for the int data type.
2. the values look a bit odd in that they are not a nice rounded value like 1,000,000. Yet, these limits are not arbitrary. How are these limits determined?
3. Give some examples where Javas limit on the maximum-sized integer it can represent poses a limitation and give some examples where we need to represent integer quantities outside of the range available in Java.
4. Is there a way in Java to represent integers bigger than what ints allow? Why would Java provide two data types to represent integral quantities?
5. Is there a way in Java for representing arbitrarily large integers? Why isnt this the default? In other words, why not have just one representation for arbitrarily large integral quantities?