-5

I think a proprem in this night, As we all know,all classes's super class is java.lang.Object, but why not it is abstract class??

2 Answers2

2

You could argue that it was simply an arbitrary design decision but the main benefit is that by not marking the class abstract you can create instances of type Object.

Since all of the methods of the Object class are fully implemented there was no inherent benefit in marking it abstract.

Mike Dinescu
  • 54,171
  • 16
  • 118
  • 151
2

Object does not have any abstract methods so making the class abstract would prevent it from being instantiated (although you would be able through: new Object() {};) which is an unnecessary restriction.

And it happens that being able to instantiate an Object is sometimes handy, for example to create a lock:

private final Object lock = new Object();
assylias
  • 321,522
  • 82
  • 660
  • 783