![[ Is a ] Relationship (Inheritance) | Java UML source Code 1 [ Is a ] Relationship (Inheritance) | Java UML source Code 1](https://old.nurnobishanto.com/wp-content/uploads/2019/10/Is-relationshipInheritance.jpg)
Shape
package Inheritance;
public class Shape {
protected int location;
public Shape(int location) {
this.location = location;
}
public void display() {
System.out.println("\n" + "Location: " + location);
}
}
Rectangle
package Inheritance;
public class Rectangle1 extends Shape{
private int height, width;
public Rectangle1(int location, int height, int width) {
super(location);
this.height = height;
this.width = width;
}
public void display() {
super.display();
System.out.println("\n" + "Height:" + height + "\nWidth: "+ width);
}
public static void main(String[] args) {
Rectangle1 r1 = new Rectangle1(5, 10, 20);
r1.display();
}
}
![[ Is a ] Relationship (Inheritance) | Java UML source Code 2 [ Is a ] Relationship (Inheritance) | Java UML source Code 2](https://mustahidscloud.com/wp-content/uploads/2019/10/r.png)
- Best Laravel App Developer in Mirpur, Dhaka – Nurnobi Shanto
- Best Laravel App Developer in Dhaka – Nurnobi Shanto
- A Podpourri of Learning Options: Pods, Hubs, and Microschools #2
- Code to Create: Showcasing Web Development Projects
- Designing for Impact: A Portfolio of Creative Solutions