A method could be called using any numeric value as an argument, whether it is a variable, a named constant, or a literal constant.
A method's declared return type must match the type of value used in the return statement. In implementation hiding, the calling method needs to understand only the interface to the method that is called and it need not know how the method works internally.
All modern programmi ng languages contain many methods that are predefined.
Methods with identical names that have identical parameter lists but different return types are ambiguous.
In this example, we have a static method that returns an integer, but we want to return nothing in a special case, then we return 0 only. Although there is nothing in integer to return, we can do this to achieve our objective.
In this example, we have a static method that returns a String, but we want to return nothing in a special case, then we return null only. Although there is nothing like nothing in String to return, we can achieve our objective.
In this example, we have a static method that returns an integer object, but we want to return nothing in a special case, then we return null only as null is a default value for objects in Java. Although there is nothing like nothing in objects to return, we can achieve our objective.