(java) abstract AND …. method #unfillable dental cavity

I think java “abstract” keyword evolved from c++ pure virtual…

abstract AND synchronized @@ no idea. I think [[ java precisely ]] covers this.

abstract AND private @@ No. http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#11244

abstract AND final @@ no. can’t be implemented

— abstract AND static @@ —
No. “It is a compile-time error for a static method to be declared abstract.” http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#11246 It all boils down to runtime^compile-time binding. First, you need to really understand that static calls are resolved at compile time — based on the declared type.

In general, given any static method s() in any baseclass B redefined in any subclass C, then C.s() can never step in to help B.s(). This holds whether B.s() is abstract or concrete.

Therefore, an abstract static method is an unfillable dental /cavity/, an /unrecoverable liability/. Such a construct makes no sense.

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

您正在使用您的 WordPress.com 账号评论。 登出 /  更改 )

Google photo

您正在使用您的 Google 账号评论。 登出 /  更改 )

Twitter picture

您正在使用您的 Twitter 账号评论。 登出 /  更改 )

Facebook photo

您正在使用您的 Facebook 账号评论。 登出 /  更改 )

Connecting to %s