I want to get proper understanding why below compilation error? As per my understanding If i use Test.xyz() then compiler look for only static method not for instance method then why below compilation fail?
class Test {
public static void main(String arg[]) {
Test.xyz(10); // compilation fail
}
public void xyz(int i) {
}
public static void xyz(Integer i) {
}
}
Every one please suggest why compilation fail rather than other suggestions and how to use , I know all basic thing Autoboxing etc .
This question is asked already by me Which method is looked first by Compiler , Static or instance method when ClassName.method() is used? but in that question most of people go in wrong direction due to mistake in my question so i moved that question to new question.