when we create any class implicitly (automatically) it super class is Object class(java.lang.Object) but if create class but it extends its our own class..... let see how that working
this class list C extend B, B extend A, A extend nothing
class A {
.....
}
class B extends A {
.....
}
class C extends B {
.....
}
But C extending B ... Java inheritance rule. one class can extends only one class. so C extends B,
every class extends Object class ....
Here is C extends B, B extends A, but A extends implicitly Object (which class has no extending any class that class extends Object class)
it means C has properties of Object class because | Object > A > B > C |, C class has also advance java Object class properties
any class extends any class those class does not extends Object.. actually there is one class which has no explicitly extends so that class extends Object class by compiler
No comments:
Post a Comment