What modifiers are allowed for methods in an Interface?

Ads
Ads

What modifiers are allowed for methods in an Interface?


Java Coder
What modifiers are allowed for methods in an Interface?
1 Answer(s)      5 years ago
Posted in : Java Beginners
Ads

Hi,

What modifiers are allowed for methods in an Interface?

thanks,

View Answers

April 16, 2013 at 12:34 PM


Hi friend,

Inside an interface defined constants are by default public static and final and the declared methods are public and abstract however, you may use these modifiers but if not used compiler will not generate the compilation error. So, for the method declaration the public and abstract modifiers are allowed.

For reading more about interface please go through the following link

roseindia.net/java/example/java/core/java-interface.shtml


Ads