Skip to content

Instantly share code, notes, and snippets.

@daveRanjan
Created November 22, 2016 12:53
Show Gist options
  • Save daveRanjan/d3bbe5c6dd9d60ffb33d6bb5e576c5cf to your computer and use it in GitHub Desktop.
Save daveRanjan/d3bbe5c6dd9d60ffb33d6bb5e576c5cf to your computer and use it in GitHub Desktop.
public class Rectangle extends Shape {
private Double length = 5.0;
private Double breadth= 10.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 length * breadth;
}
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment