Skip to content

Commit

Permalink
Created 2 interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
YevhenSrdk committed Nov 1, 2024
1 parent 0e62eca commit 450a4cd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/main/java/core/basesyntax/AreaCalculable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package core.basesyntax;

public interface AreaCalculable {
public abstract double getArea();
}
5 changes: 5 additions & 0 deletions src/main/java/core/basesyntax/Drowbale.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package core.basesyntax;

public interface Drowbale {
public abstract void draw();
}
16 changes: 11 additions & 5 deletions src/main/java/core/basesyntax/Figure.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
package core.basesyntax;

public abstract class Figure {
public class Figure implements Drowbale, AreaCalculable {
private String color;

public Figure(String color) {
this.color = color;
}

public abstract double getArea();

public abstract void draw();

public String getColor() {
return color;
}

public void setColor(String color) {
this.color = color;
}

@Override
public double getArea() {
return 0;
}

@Override
public void draw() {

}
}

0 comments on commit 450a4cd

Please sign in to comment.