Is it possible to inherit a class without using extends keyword in Java ?
Yes. Every class extends Object, whether you add extends Object to the declaration or not.
There are also anonymous classes, such as
Foo foo = new Foo(){
// some method implemented in here.
};
which can extend a class without extends.
Yes, Each class extend the Object by default without declaration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With