I am studying from Bert's book on page number 231 there is topic of parseXxx(0 and valueOf(). I have some confusion in it. In book it is stated that parseXxx() returns the named primitive. valueOf() returns a newly created wrapped object of the type that invoked the method. and example is
This is fine. But when I use wrapper Class Long instead of primitive long it works fine and vice versa on line 3. If both works fine with both primitive and wrapper then can you please guide me that whats the difference between both??