Last active
December 6, 2019 14:37
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
class Rectangle{ | |
public Integer width = 0; | |
public Integer height = 0; | |
Rectangle(Integer _width, Integer _height){ | |
width = _width; | |
height = _height; | |
} | |
public Integer area(){ | |
return width * height; | |
} | |
} | |
class Square extends Rectangle{ | |
Square(Integer side){ | |
super(side, side); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment