can interfaces have methods which are declared abstract
Chandra Bairi
Ranch Hand
Joined: Sep 12, 2003
Posts: 152
posted
0
can interfaces have methods which can be declared with the keyword abstract. i read a book which says that the keyword is superflous and would not compile does the code get compiled for me it is compiling properly
Thanks,
Shekar
Ernest Friedman-Hill
author and iconoclast
Marshal
Section 9.4 of the Java Language Specification says
For compatibility with older versions of the Java platform, it is permitted but discouraged, as a matter of style, to redundantly specify the abstract modifier for methods declared in interfaces.
The keyword does appear to be superfluous. A class implementing an interface with such a method will compile fine even if it makes the method concrete. [ November 13, 2003: Message edited by: Jason Menard ]