1

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.

a3.14_Infinity
  • 5,653
  • 7
  • 42
  • 66

0 Answers0