Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class Shape{
- abstract void draw();
- }
- class Rectangle extends Shape{
- void draw(){System.out.println("drawing rectangle");}
- }
- class Circle1 extends Shape{
- void draw(){System.out.println("drawing circle");
- }
- }
- abstract class TestAbstraction1{
- public static void main(String args[]){
- Shape s=new Circle1();
- s.draw();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement