Last active
March 16, 2019 15:30
-
-
Save vincentius15/ec400337a5a7e95d959fdf24c1cbfde5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public class Square { | |
public int topLeftCoordinateX; | |
public int topLeftCoordinateY; | |
public int side; | |
} | |
public class AreaCalculator{ | |
public double area(Object shape){ | |
if (shape instanceof Square){ | |
Square square = (Square) shape; | |
return Math.pow(square.side, 2); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment