Skip to content

Instantly share code, notes, and snippets.

@daveRanjan
Created November 22, 2016 12:55
Show Gist options
  • Save daveRanjan/cce7f05dccde231060a8f14685275205 to your computer and use it in GitHub Desktop.
Save daveRanjan/cce7f05dccde231060a8f14685275205 to your computer and use it in GitHub Desktop.
public class AreaFinder{
 
public static void main(String[] args){
//This will create an object of circle class
Shape circle = new Circle();
//This will create an object of Rectangle class
Shape rectangle = new Rectangle();
// Drumbeats ……
//This should print 78.5
System.out.println(“Shape of circle : “+circle.area());
//This should print 50.0
System.out.println(“Shape of rectangle: “+rectangle.area()); 
}
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment