posted 23 years ago
Hi Cindy,
Thanks for your reply.
But, I think both the constructor and the static method are serving the same purpose here - returning a Long object. And the static method will also be creating a new Long object, without doing this, it can not return a Long object. So, I don't see the difference between these two methods.
To illustrate,
String S = "4323423423"
Long L1 = new Long(S);
Long L2 = Long.valueOf(S);
These two lines look the same to me, and I really don't care whether I am using a constructor or a static method, as long as I get a Long from a String. So, why I have two methods?
Manfred,
I fail to see the analogy of this question with your 'tires' question. At the risk of being labelled a person with no sense of humor, I have to ask you to please be more elaborate in your postings.
-Asuthosh.