The only restriction on method overloading is the signature of the method.The signature is the number, type, and order of the arguments passed to a method.Any number of methods which have the same name(unless overridden) cannot have the same signature,though they can have the same return types in the same scope.The compiler uses the signature to detect which overloaded method to refer when a overloaded method is called.If two methods have the same name and signature the compiler will throw an runtime error.