1

I've recently realised that an interface can be declared like this in Java.

public abstract interface Foo
{
    // ... body
}

Why is this a valid syntax? Semantically, it doesn't make any sense to me (ie., an interface is already abstract, isn't it? ). Is there any difference between an interface declared with abstract and the one without?

One Two Three
  • 22,327
  • 24
  • 73
  • 114

1 Answers1

4

It's not required because it's implicitly there for all interfaces. There is no difference in including it or not. It's odd to include it so I would avoid it.

Oleksi
  • 12,947
  • 4
  • 56
  • 80