Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class PaintShape {
- String shapeName;
- int coverage;
- public PaintShape(String shapeName, int coverage) {
- this.shapeName = shapeName;
- this.coverage = coverage;
- }
- public abstract double area();
- public void printShape() {
- System.out.println("shapename is " + this.shapeName + "coverage is " + this.coverage);
- }
- public double amount() {
- double area = area();
- double amount = area / coverage;
- return amount;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment