I was going through some basic java concepts. I was looking into methods and trying to verify this error
"MethodSignature.java:10: error: method m1(String) is already defined in class MethodSignature
public static void m1(String s)"
The above error appears when I run from command prompt. But when running through eclipse, although it shows error, program prints the desired strings. I do not get any error as stated above in case of command prompt.
Why there is a difference in execution in Eclipse and command prompt?
As in command prompt, I am not able to run the program itself because the error should stop me. I was expecting the same in Eclipse.
Here is my simple program.
public static void m1(String s)
{
System.out.println(s);
}
public static void m1(String s)
{
System.out.println(s);
}
public static void main(String[] args)
{
m1("call one");
m1("call two");
}