This content has been marked as final. Show 9 replies
Because Java is an Object Oriented Programming Language.
Because everything in Java is an object (except for primitives).
but i thinks this won't be proper answer,
as i can create my own class and extends some new class to this.
there might be some reason ,as it is been there.
You realize that if you create your own class, then it extends Object, whether you like it not, right?
thats what i am asking. as why they defaulted any class extensions to object class.
there could be some reason..........
Every non-primitive in Java is an Object. So it has to subclass Object somehow, either directly or indirectly.
Are you asking why a class declaration without an "extends" clause defaults to extending Object? What else would you have it default to?
Object wraps basic operation of a Object in Java like:
I feel its good way to do that, as it give uniformity
Hi All,Because that way we can have methods that can operate on any type of object--taking an Object as a parameter, and we can have certain methods--toString, etc.--that we know will always be available on every object.
why do java has Object Class????
It was a design decision to make things easier.
Given the other design decision (no multiple inheritance among classes), it makes sense.