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.

3
  • 4
    stackoverflow.com/questions/512877/… Commented Feb 18, 2014 at 14:52
  • In Java 8, interfaces can have static methods Commented Feb 18, 2014 at 14:57
  • @Zeeshan that's covered in the Q/A as well Commented Feb 18, 2014 at 15:01

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.