Name: dbT83986 Date: 02/03/99
in a final class, all methods are implicitly
final, yet reflection does not label them as such.
i was of the understanding (and i think it's in
JLS somewhere) that specifying a method as final
in a final class has no effect. however, this prints
out false
public final class p {
public void thing() { }
public static void main(String[] args) throws Throwable {
System.out.println(java.lang.reflect.Modifier.isFinal(
p.class.getMethod("thing", new Class[0]).getModifiers()
));
}
}
whereas declaring thing() to be final causes the
output to be "true". Is this as intended?
(Review ID: 39440)
======================================================================