What modifiers are allowed for methods in an Interface?

What modifiers are allowed for methods in an Interface?

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









Related Tutorials/Questions & Answers:
What modifiers are allowed for methods in an Interface?
What are Callback interfaces?
Advertisements
what is the difference between access specifiers and access modifiers in java?
What are the Core interfaces are of Hibernate framework?
Access Modifiers
What are Classes and Interfaces in Java?
What are weak methods?
what is class methods in objective c
what is class methods in objective c
interfaces
Identify the interfaces and methods a CMP entity bean must and must not implement.
What are the most common methods of Hibernate configuration?
Identify the interfaces and methods a JMS message-driven bean must implement.
What's the proper way to test a class with private methods using JUnit?
methods
methods
methods
EJB Interfaces
Why is super.super.method(); not allowed in Java?
Explain various access modifiers and their visibility.
ModuleNotFoundError: No module named 'access-modifiers'
EJB Interfaces
ModuleNotFoundError: No module named 'odoo10-addon-purchase-allowed-product'
ModuleNotFoundError: No module named 'odoo11-addon-purchase-allowed-product'
java interfaces implementation
Various methods of httpservletresponse interface
Hibernate: core interfaces of hibernate framework
Marker interfaces in java
native methods
static methods
ModuleNotFoundError: No module named 'interfaces'

Ads