The following is allowed:-
public interface JustImplementMe
{
public void ClimbMountain();
}
The following is not allowed:-
public interface StaticMethodInterface
{
public static void Climb();
}
The following is allowed:-
public class Classic implements JustImplementMe
{
public void ClimbMountain()
{
}
}
The following is not allowed:-
public class ClassicMusic implements JustImplementMe
{
public static void ClimbMountain()
{
// static method cannot hide the instance method in JustImplementMe
}
}
Why is it so? Thanks.
No comments:
Post a Comment