Name: ###@###.### Date: 09/05/96
Java language specification (8.4.3 Method Modifiers) says:
"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."
(See also 8.4.3.1-5)
However compiler doesn't report any error for the following cases:
-----------------------clss12301.java---------------------------
abstract class clss12301_a {
private abstract void f1(); //compile-time error
final abstract void f2(); //compile-time error
native abstract void f3(); //compile-time error
synchronized abstract void f4(); //compile-time error
}
-------------------------------------------------------------
> javac clss12301.java
>
======================================================================
- duplicates
-
JDK-4068672 javac allows private abstract method to go unimplemented
- Closed
-
JDK-4090977 abstract synchronized methods should not be allowed
- Closed
-
JDK-4098789 abstract and other method modifiers
- Closed
-
JDK-4064699 declaration of abstract synchronized methods not prohibited
- Closed
-
JDK-4149863 abstract private methods allowed
- Closed