generated from mate-academy/jv-homework-template
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b03b22
commit cb15c81
Showing
13 changed files
with
92 additions
and
8 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package core.basesyntax; | ||
|
||
import core.basesyntax.model.AreaCalculator; | ||
import core.basesyntax.model.Circle; | ||
import core.basesyntax.model.Figure; | ||
|
||
/** | ||
* Feel free to remove this class and create your own. | ||
*/ | ||
public class HelloWorld { | ||
public static void main(String[] args) { | ||
|
||
System.out.print(String.format("%s. Color: %s. ", this.getClass().getSimpleName(), color)); | ||
final int amountFigures = 6; | ||
final int HALF_FIGURES_COUNT = 3; | ||
AreaCalculator figure = new Circle(); | ||
figure.setColor(""); | ||
figure.getArea(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package core.basesyntax; | ||
|
||
public class Circle extends Figure { | ||
@Override | ||
public void draw() { | ||
System.out.println("Circle"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package core.basesyntax.model; | ||
|
||
public enum Color { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package core.basesyntax; | ||
|
||
import java.awt.*; | ||
|
||
public abstract class Figure { | ||
String color; | ||
|
||
public abstract void draw(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package core.basesyntax; | ||
|
||
public class IsoscelesTrapezoid extends Figure implements Drawable { | ||
@Override | ||
public void draw() { | ||
System.out.println("Isosceles Trapezoid"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package core.basesyntax; | ||
|
||
public class Rectangle extends Figure implements Drawable { | ||
@Override | ||
public void draw() { | ||
System.out.println("Drawing a rectangle"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package core.basesyntax; | ||
|
||
public class RightTriangle extends Figure implements Drawable { | ||
@Override | ||
public void draw() { | ||
System.out.println("Right Triangle"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package core.basesyntax; | ||
|
||
public class Square extends Figure implements Drawable { | ||
@Override | ||
public void draw() { | ||
System.out.println("Square"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package core.basesyntax.model; | ||
|
||
public interface AreaCalculator { | ||
String color = ""; | ||
|
||
void getArea(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package core.basesyntax.service; | ||
|
||
public class ColorSupplier { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package core.basesyntax.service; | ||
|
||
public interface Drawable { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package core.basesyntax.service; | ||
|
||
public class FigureSupplier { | ||
} |