Name: rm29839 Date: 11/05/97
Compile the following Java source:
// SyncTest.java - begin
public abstract class SyncTest
{
public abstract synchronized void methodName();
}
// SyncTest.java - end
Compile with:
javac SyncTest.java
The compile is successful but according to Sun's
Java language specifications:
http://java.sun.com/docs/books/jls/html/8.doc.html#78188
Section 8.4.3 contains the sentence:
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. Consequently, the above program
should have been flagged as an error.
(Review ID: 18865)
======================================================================
ronan.mandel@Eng 1997-11-05
Is the spec or the implementation wrong?
- duplicates
-
JDK-1266571 no error for abstract method with private, final, native, synchronized modifiers
- Closed