Skip to content

Instantly share code, notes, and snippets.

@daveRanjan
Created November 22, 2016 12:52
Show Gist options
  • Save daveRanjan/9b70d4697f009c54ee5a386a83ca9845 to your computer and use it in GitHub Desktop.
Save daveRanjan/9b70d4697f009c54ee5a386a83ca9845 to your computer and use it in GitHub Desktop.
public class Circle extends Shape {
private Double radius = 5.0;
// See this annotation @Override, it is telling that this method is from parent
// class Shape and is overridden here
@Override
public Double area(){
return 3.14 * radius * radius;
}
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment