Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

Can a method inside a Interface be declared as final?

Ads

 
 

Share on Google+Share on Google+

Java Coder
Can a method inside a Interface be declared as final?
1 Answer(s)      4 years and 3 months ago
Posted in : Java Beginners

Hi,

Can a method inside a Interface be declared as final?

Thanks,

Ads
View Answers

April 15, 2013 at 11:46 AM


Hi friend,

No, we can't declare a final method inside the interface. Doing so, the Java compiler will give the compilation error. This is because the methods declared inside the interface must have to implemented by its implementing class. Inside the interface only public and abstract modifier is allowed for declaring a method.

For more detail you can go through the following link

http://www.roseindia.net/java/master-java/interface.shtml


Ads