2

As we know, interface is to define some method, but some interface defined as a abstract interface, but why ? for example:

public abstract interface Test{

}

what is the advantage for using abstract to define a interface?

Vegard
  • 4,802
  • 1
  • 20
  • 30

3 Answers3

4

There is no need to add that abstract key word. It's redundant there.

Interfaces are implicitly abstract.

Language Spec JLS# 9.1.1.1 abstract Interfaces

Every interface is implicitly abstract.

This modifier is obsolete and should not be used in new programs.

Community
  • 1
  • 1
Suresh Atta
  • 120,458
  • 37
  • 198
  • 307
0

refer to http://docs.oracle.com/javase/tutorial/java/IandI/createinterface.html for the same.

Also see https://stackoverflow.com/a/18778307/805378 to get the difference between abstract and interface.

Community
  • 1
  • 1
Piyush
  • 2,040
  • 16
  • 14
-1

to make a class 100% abstract without using 'abstract'.

Chowdappa
  • 1,580
  • 1
  • 15
  • 31