4 changed files with 24 additions and 0 deletions
@ -0,0 +1,7 @@ |
|||
public class Retangle extends Shape{ |
|||
@Override |
|||
protected void draw(){ |
|||
System.out.println("Retangle is drawn."); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
abstract class Shape{ |
|||
Shape shape; |
|||
abstract void draw(); |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
public class Truck extends Vehicle{ |
|||
protected Truck(String name){ |
|||
this.s=name; |
|||
} |
|||
@Override |
|||
public void run(){ |
|||
System.out.println(s+" is running"); |
|||
} |
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
abstract class Vehicle { |
|||
String s; |
|||
abstract void run(); |
|||
} |
|||
Loading…
Reference in new issue