B
Brian J. Sayatovic
Years ago, when I first searched on how to get the class for a
primitive type, I learned the Integer.TYPE convention. At the time, I
assumed this was the only way, but it turns out it was the first way I
happened to find in my search results. You can also do int.class.
But why support both?
The Integer.TYPE javadocs say it's been around since JDK 1.1. I did
some Googling and found that the universal ".class" notation has also
been around since JDK 1.1. I could understand if one pre-dated the
other and they wanted to later add a better solution and not get rid
of the old one, but that doesn't appear to be the case.
So, again, why did we reach the point where both are supported?
Regards,
Brian.
primitive type, I learned the Integer.TYPE convention. At the time, I
assumed this was the only way, but it turns out it was the first way I
happened to find in my search results. You can also do int.class.
But why support both?
The Integer.TYPE javadocs say it's been around since JDK 1.1. I did
some Googling and found that the universal ".class" notation has also
been around since JDK 1.1. I could understand if one pre-dated the
other and they wanted to later add a better solution and not get rid
of the old one, but that doesn't appear to be the case.
So, again, why did we reach the point where both are supported?
Regards,
Brian.