Hello friends
Can someone Explain me why the below is giving a Warning instead of Error :-
package one
public class
Test {
void met()
{
System.out.println("Method met of Test Class ");
}
public static void main(
String[] args)
{
System.out.println("Hello Main() of Test Class ");
}
}
package two
public class OtherTest
{
int met()
{
System.out.println("Method met of Test Class ");
return 1;
}
public static void main(String[] args)
{
System.out.println("Hello Main() of OtherTest Class ");
}
}
In the Above, I have tried to Override Method met with different
return type, but instead of giving Error, it is giving me below Warning
"OtherTest.java:0: Note: Method int met() in class two.OtherTest does not override the corresponding method in class one.Test. If you are trying to override this method, you cannot do so because it is private to a different package. package two;
Thanks.