I want to convert a String to Long. But I have found 4 different ways to archive that propouse.
Long.getLong(s) - Determines the long value of the system property with the specified name.
Long.valueOf(s) - Returns a Long object holding the value of the specified String
Long.parseLong(s) - Parses the string argument as a signed decimal long.
new Long(s) - Constructs a newly allocated Long object that represents the long value indicated by the String parameter
Besides that "parseLong()" return a long value and the other 3 return Long object. What are the differences between them, what is the best case of use for them?(when to use them), which one gives better performance?
Thanks in advance.
EDIT :
This gave me the difference between "valueOf(s)" and "new Long(s)" and also found the diference between "valueOf(s)" and "Long.parseLong(s)".
But I still dont get Long.getLong(s) what is used for. What does "Determines the long value of the system property with the specified name" means?