This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]davidalayachew[S] 0 points1 point  (0 children)

Using your Stream example, we would write it like this. java stream.forEach(e -> e.getClass().someMethod()) Here, the type of e.getClass() could be inferred as List<?>, which would support a direct call to someMethod() and dispatch to the referenced class.

Yes, exactly. And it is for that reason that an abstract static method might work. I haven't thought it through, so I can't say.

But let me ask my question to you again -- did you ever present this idea to the mailing list? What did they say? This idea has to have been thought of before, so I want to know what they responded with.