Created
November 22, 2016 12:48
-
-
Save daveRanjan/2036ce19cfa6da0dd49af57ed95309ec to your computer and use it in GitHub Desktop.
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
public class Shape{ | |
//It could be a circle or rectangle or square | |
private String type; | |
//To calculate area of rectangle | |
public Double area(Long length, Long breadth){ | |
return (Double) length * breadth; | |
} | |
//To calculate area of a circle | |
public Double area(Long radius){ | |
return (Double) 3.14 * r * r; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment