Forum Stats

  • 3,827,142 Users
  • 2,260,745 Discussions
  • 7,897,182 Comments

Discussions

What happens to abstract classes now?

hey_prakash
hey_prakash Member Posts: 6
edited May 22, 2014 5:34AM in Java 8 Questions

As we can write default implementations to the methods in a interface, what happens to abstract classes now?

ktnagel

Answers

  • jwenting
    jwenting Member Posts: 4,864 Gold Badge

    just because you can doesn't mean you should. And this is a clear case of you should not.

    Allowing implementation in interfaces is a dirty hack they needed to put in to be able to bolt on some of the other stuff without breaking forward compatibility with existing code.

    That doesn't make it a good idea, in fact it's a pretty good indication that the stuff they hacked in this way is itself not a good idea.

    ktnagel