Name: rm29839 Date: 12/11/97
The language spec states the following:
8.4.3 Method Modifiers
MethodModifiers:
MethodModifier
MethodModifiers MethodModifier
MethodModifier: one of
public protected private
abstract static final synchronized native
The access modifiers public, protected, and private are discussed in §6.6. A compile-time error occurs if the same modifier appears more than
once in a method declaration, or if a method declaration has more than one of the access modifiers public, protected, and private. A
compile-time error occurs if a method declaration that contains the keyword abstract also contains any one of the keywords private, static,
final, native, or synchronized.
If two or more method modifiers appear in a method declaration, it is customary, though not required, that they appear in the order consistent with that
shown above in the production for MethodModifier.
JDK1.1.5 will accept a method that has abstract and one of the other modifications
i.e, it doesn't meet the lang. spec
This code compiles without error on 114 and 115
public abstract class Modifier{
public static void main(String [] args){
System.out.println("This is the Main Method...");
}
private final abstract void doesItWork();
//abstract method
}
(Review ID: 21762)
======================================================================
- duplicates
-
JDK-1266571 no error for abstract method with private, final, native, synchronized modifiers
- Closed