Lavjeet: I think No�l probably answered your question
, but I'm adding this in response to your private message...
Literal
integral values are automatically considered type int. Therefore, when you call a method and provide literal integral values as arguments, then the compiler will look for the method that accepts ints as arguments.
Specifically, when you call m1(10, 10), the compiler looks for a method defined as m1(int x, int y).
If the compiler can't find such a method, then it looks for a method that accepts primitive arguments that are
wider than what you provided, and automatically converts the ints you passed to the wider type. This is "method-call conversion," and presents no problem because widening a value doesn't lose any information.
However, the compiler will
not automatically convert the arguments you provided to a narrower type (byte, char, or short), because that could result in a loss of information and give unexpected results.
So when you call m1(10, 10) with ints, and the compiler can only find m1() defined to take narrower arguments (like bytes or shorts), then it will give an error saying that it cannot find the requested method.