The Long.getLong(String nm,long val) java method determines the long value of the system property with the specified name.
The first argument is treated as the name of a system property. System properties are accessible through the System.getProperty(java.lang.String) method. The string value of this property is then interpreted as a long value using the grammar supported by decode and a Long object representing this value is returned.
The second argument is the default value. A Long object that represents the value of the second argument is returned if there is no property of the specified name, if the property does not have the correct numeric format, or if the specified name is empty or null.
In other words, this method returns a Long object equal to the value of:
getLong(nm, new Long(val))
but in practice it may be implemented in a manner such as:
Long result = getLong(nm, null);
return (result == null) ? new Long(val) : result;
to avoid the unnecessary allocation of a Long object when the default value is not needed.
Make a note that the getLong() method of Long class is static thus it should be accessed statically which means the we would be calling this method in this format:
Non static method is usually called by just declaring method_name(argument) however in this case since the method is static, it should be called by appending the class name as suffix. We will be encountering a compilation problem if we call the java getLong method non statically.