can an interface be declared final in java?

No, we cannot declare final interface in java because its implementation is provided by another class and final interface can not be implemented.

Example

final interface SubtractionTest {
 
    void subtraction(int num1, int num2);
 
 }
 
public class Main implements SubtractionTest
{
    public void subtraction(int num1, int num2) {
        System.out.println(num1 - num2);
    }
 
	public static void main(String[] args) {
		Main main = new Main();
		main.subtraction(150, 100);
	}
}

Output

Main.java:1: error: illegal combination of modifiers: interface and final
final interface SubtractionTest {
      ^
Main.java:7: error: cannot inherit from final SubtractionTest
public class Main implements SubtractionTest
                             ^
2 errors

Java interview questions on interface and abstract class

Please Share