Now the reply from Sun forum (this is what I thought, but was not 100% sure, now I'm):
You can think of: Integer foo = 10 as: Integer foo = Integer.valueOf(10); which means that it first parse the 10, then create the object, hence two operations. With: Integer foo = new Integer(10); one operation, and moreover optimized. Of course, from the point of view of printing it, it makes no difference, but from the point of view of the initialization, it is not the same. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
