This content has been marked as final. Show 7 replies
Try removing the Map<K, V> from the implements clause and see what happens.
As I recall, it's not necessary to specify that it implements Map here for the reasons you gave. Maybe the coder added that just for clarity.
But either way you can tell with a test.
Try removing the Map<K, V> from the implements clause and see what happens.How can I edit sources of JDK API?
I know JDK provides a src.zip, I could edit the source in that archive file.
But I have to compile the source I edit, that may be a little complicated.
Oops my mistake. I missed that part of your post.
But you can easily write your own test in a standalone class.
If with my own test, I'm almost sure of it's not necessary to do the declaration.
I agree with you; I don't think it's necessary to declare that it implements Map if it extends AbstractMap; I don't think it makes any difference that this code is part of the standard library; and I think it was declared as such for clarity only.
I don't think it makes any difference that this code is part of the standard libraryAbsolutely, I agree on the view.
I think it was declared as such for clarity only.I just be curious with the little topic.
"clarity" may be the answer.
Wasn't there a thread about this just a while ago?
About how it actually does affect the class, when using reflection to find out which interfaces it implements. At least as far as I remember. Someone confirm or deny.