
Java
public class Parent {
...
..
}
public class Child extends Parent {
...
..
.
}
Here the class Child extends the class Parent and hence the methods of Parent are available for Child to use. This way we are re-using the code in the parent class in the child class instead of re-writing the whole thing again.
Copyright © 2026 eLLeNow.com All Rights Reserved.