Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface Drawable{
- void draw();
- }
- class Rectangle implements Drawable{
- public void draw(){System.out.println("drawing rectangle");}
- }
- class Circle implements Drawable{
- public void draw(){System.out.println("drawing Circle");}
- }
- class testInterface{
- public static void main(String args[]){
- Drawable d= new Circle();
- d.draw();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement