Why does every object in Java implicitly extend java.lang.Object class?

I would say that the reason is to have a common API for all objects in java to supports basic functionality like

  • synchronizationwait, notify, notifyAll
  • garbage collectionfinalize
  • collection supporthashCode, equals
  • object cloningclone

And every object

  • has a class it belongs to – getClass
  • can represent itself as a string, because we are
    humans and can read strings – toString

Leave a Comment