Why is this not Javadoc’d clearly?
Integer.MAX_VALUE = 2147483647 Integer.MIN_VALUE = -2147483648 Long.MAX_VALUE = 9223372036854775807 Long.MIN_VALUE = -9223372036854775808
Why is this not Javadoc’d clearly?
Integer.MAX_VALUE = 2147483647 Integer.MIN_VALUE = -2147483648 Long.MAX_VALUE = 9223372036854775807 Long.MIN_VALUE = -9223372036854775808
They are documented quite clearly via the JavaDoc for Integer.MAX_VALUE etc. Look where it says “See also: Constant Field Values”
The values are clearly displayed there, e.g.
http://download.oracle.com/javase/6/docs/api/constant-values.html#java.lang.Integer.MAX_VALUE
Regards,
Tim
LikeLiked by 1 person
And for Java 8: https://docs.oracle.com/javase/8/docs/api/constant-values.html#java.lang.Integer.MAX_VALUE
LikeLike
Yes, that’s true, the information is there, buried.
The implementation of the documentation for constant field values feels like an added-on after thought.
I have a hard time imagining someone (or people in a meeting) saying: Ok, let’s make this information available, it is indeed useful. But, let’s make them jump through a hyperlink to get there because… what?
What is worse in this specific case is that the Javadoc for Long.MAX_VALUE does give a value (2^63 – 1) Why one and not the other?
It’s Math and CS-like to write in powers of 2, yes, but a pain for writing documentation for normal humans.
LikeLike
Payamy:
Interesting arguments, and there are some fun-to-know facts about the Integer.MAX_VALUE, like How many characters can a Java String have?
LikeLike
How can you declare a really big matrix in Java? Like 3B x 3B entries? Java does not let you define arrays with long, just with int, and int is not enough… any suggestions?
LikeLike
The trouble is that there is so much information that it is all, in effect, “buried.” That’s an unfortunate result of such a rich and powerful language.
Suggestions for a 2D array with 3B * 3B entries? Well, other than coupling every computer in the world together to make a single virtual machine to run your JVM, I would recommend using a database to store that (MY SQL or SQL Lite).
LikeLiked by 1 person
As presented here, these values are incorrect. For example, “9223372036854775807” is an integer literal, not a long literal. As an integer, it’s much too large. You mean “9223372036854775807L”, which is a long literal and will correctly compile.
LikeLike
Have a query i came to know that for int unsigned min val is 0 & max is how much.How do we come to know what are signed & unsigned how can we get maximum & minimum values for all data types in java.Could any one tell me
LikeLike
Sun, on their “infinite wisdom” have decided that there are no unsigned types in java (although the JVM implementation would be the same).
As a result, it’s a total pain to implement anything that reads/processes/writes binary records.
LikeLike
Amazing isn’t it?
LikeLike